我想使用地球移动器距离测量两个直方图之间的距离,也称为Wasserstein度量。我从图像中提取直方图。
这就是我从图像中提取直方图的方法:
[N1,X1]=hist(image1,128)
[N2,X2]=hist(image2,128)
128表示直方图中的类数。
function [x, fval] = emd(F1, F2, W1, W2, Func)
% EMD Earth Mover's Distance between two signatures
% [X, FVAL] = EMD(F1, F2, W1, W2, FUNC) is the Earth Mover's Distance
% between two signatures S1 = {F1, W1} and S2 = {F2, W2}.
% F1 and F2 consists of feature vectors which describe S1 and S2, respectively.
% Weights of these features are stored in W1 and W2.
% FUNC is a function which computes the ground distance between two feature vectors.
但我真的不知道如何在我的情况下应用它。事实上,在我的情况下,F1和F2是什么?什么是重量?!
谢谢!