![]() |
ICSV - Image Color Similarity Visualization
Vienna Technical University - Course 'Visualization 2'. Author: Stefan Spelitz (0925601)
|
See https://github.com/telmomenezes/JFastEMD/blob/master/src/com/telmomenezes/jfastemd/JFastEMD.java More...
Static Public Member Functions | |
static double | distance (Signature signature1, Signature signature2, double extraMassPenalty) |
This interface is similar to Rubner's interface. See: http://www.cs.duke.edu/~tomasi/software/emd.htm More... | |
See https://github.com/telmomenezes/JFastEMD/blob/master/src/com/telmomenezes/jfastemd/JFastEMD.java
This class computes the Earth Mover's Distance, using the EMD-HAT algorithm created by Ofir Pele and Michael Werman.
This implementation is strongly based on the C++ code by the same authors, that can be found here: http://www.cs.huji.ac.il/~ofirpele/FastEMD/code/
Some of the author's comments on the original were kept or edited for this context.
|
static |
This interface is similar to Rubner's interface. See: http://www.cs.duke.edu/~tomasi/software/emd.htm
This method computes the EMD between the given two signatures.
To get the same results as Rubner's code you should set extra_mass_penalty to 0, and divide by the minimum of the sum of the two signature's weights. However, I suggest not to do this as you lose the metric property and more importantly, in my experience the performance is better with emd_hat. for more on the difference between emd and emd_hat, see the paper: A Linear Time Histogram Metric for Improved SIFT Matching Ofir Pele, Michael Werman ECCV 2008
To get shorter running time, set the ground distance function to be a thresholded distance. For example: min(L2, T). Where T is some threshold. Note that the running time is shorter with smaller T values. Note also that thresholding the distance will probably increase accuracy. Finally, a thresholded metric is also a metric. See paper: Fast and Robust Earth Mover's Distances Ofir Pele, Michael Werman ICCV 2009
If you use this code, please cite the papers.
signature1 | The first signature |
signature2 | The second signature |
extraMassPenalty | The penalty for extra mass. If you want the resulting distance to be a metric, it should be at least half the diameter of the space (maximum possible distance between any two points). If you want partial matching you can set it to zero (but then the resulting distance is not guaranteed to be a metric). Default value is -1 which means the mass penalty is set to the maximum ground-distance between the two signatures. See also the 'emdHat' function. |