【问题标题】:The Earth Mover's Distance/ Wasserstein metric between 2 histograms (MATLAB)两个直方图之间的 Earth Mover 距离/ Wasserstein 度量 (MATLAB)
【发布时间】:2017-12-14 04:20:05
【问题描述】:

我想使用地球移动距离(也称为 Wasserstein 度量)来测量两个直方图之间的距离。我从图像中提取直方图。

这就是我从图像中提取直方图的方式:

[N1,X1]=hist(image1,128)
[N2,X2]=hist(image2,128)

128 表示直方图中的类数。

所以我在这里找到了代码:https://fr.mathworks.com/matlabcentral/fileexchange/22962-the-earth-mover-s-distance?focused=5110777&tab=function

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 et F2 是什么?权重是多少?!

谢谢!

【问题讨论】:

  • 这是一个关于 EMD 的数学问题,而不是编程问题。该问题并非特定于上述实现。考虑在math.stackexchange.com 询问(并在此处删除)。

标签: matlab image-processing histogram distance


【解决方案1】:

这些特征将是您正在查看的概率度量的概率的不同特征。如果考虑一组人眼睛的颜色,其中一个特征可能是“蓝色”特征。权重将是具有该特定特征的人数。我希望这是有道理的!

我个人不是 Matlab 类型的人,但是 this 是一篇很好的博文,它展示了如何在 Julia 中计算这个距离。

数学栈溢出的一个相关问题here

Wiki link here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-25
    • 2020-12-16
    • 2017-04-02
    • 2018-02-22
    • 1970-01-01
    • 1970-01-01
    • 2014-09-20
    • 2014-02-20
    相关资源
    最近更新 更多