Earth Mover的Distance / Wasserstein度量在2个直方图之间(MATLAB)

问题描述 投票:0回答:1

我想使用地球移动器的距离测量两个直方图之间的距离,也称为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和F2是什么?什么是重量?!

谢谢!

matlab image-processing histogram distance
1个回答
0
投票

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

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

数学堆栈中的相关问题溢出here

Wiki link here

© www.soinside.com 2019 - 2024. All rights reserved.