distance/similarity measure algorithms

24 views
Skip to first unread message

Sacha Camilleri

unread,
Feb 24, 2015, 4:44:44 PM2/24/15
to jfeat...@googlegroups.com
Hi,
Thanks for the JFeatureLib. I would like to ask if this library contains any distance/similarity measure algorithms, for example to calculate the distance between two colour histograms and other king of histograms? 
Regards,
Sacha

Johannes Niedermayer

unread,
Feb 25, 2015, 3:31:17 AM2/25/15
to jfeat...@googlegroups.com
Hi Sacha,

for this purpose I would recommend Elki, which is beeing developed by the Database Systems Group at LMU Munich.
http://elki.dbs.ifi.lmu.de/

It provides a large amount of different distance functions, see package de.lmu.ifi.dbs.elki.distance.distancefunction in the javadoc http://elki.dbs.ifi.lmu.de/releases/release0.6.5~20141030/doc/index.html

Best Regards

Johannes
--
You received this message because you are subscribed to the Google Groups "JFeatureLib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jfeaturelib...@googlegroups.com.
To post to this group, send email to jfeat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sacha Camilleri

unread,
Feb 25, 2015, 3:06:26 PM2/25/15
to jfeat...@googlegroups.com
Thanks Johannes! I can't thank you enough for referring me to such another great library. I would also like to ask for a suggestion (I'm not sure if this is the right place). 

I would like to perform similarity measure between HSB color histograms of the JFeatureLib (quantised in a 7x3x3 for a total of 63 bins). For this I was thinking of first calculating the Euclidean distance in a bin-to-bin approach and then use Manhattan distance between bins to come up with a single value that represents the distance between the two histograms. However, from the vast ELKI library I am sure there are more accurate algorithms such as the Chisqaure and Quadratic-form distance that utilizes information across bins to retrieve more perceptually desirable results. Can someone suggest, from his experience, what will be a good distance function to calculate two HSB color histograms? 

Besides I am also planing to implement Tamura features. From the research that I have done, this algorithm return a vector that represents three 'unrelated' features. (1st element: coarseness, 2nd element: contrast, 3rd-18th element: directional). Shall the distance between two tamura feature vectors be measured as a whole OR is it better for the distance between these three features to be measured independently (possible with different distance functions).

Thanks again,
Sacha 

Johannes Niedermayer

unread,
Feb 27, 2015, 7:25:38 AM2/27/15
to jfeat...@googlegroups.com
Hi Sacha,

Basically the Euclidean distance already sums up the values of the bins: sqrt((binA1-binB1)²+...+bin(An-binBn)²), so the Manhattan distance is not necessary at this point. Generally, there exist specialized distance measures for histograms as you said:
1) Mahalanobis distance (sometimes named Quadratic-Form DF as you said) https://en.wikipedia.org/wiki/Mahalanobis_distance
2) Histogram Intersection Distance de.lmu.ifi.dbs.elki.distance.distancefunction.HistogramIntersectionDistanceFunction
3) Earth Movers Distance https://en.wikipedia.org/wiki/Earth_mover%27s_distance
I would give all of them a try. From what I have read, Mahalanobis was sometimes referred to as being better than Euclidean, however it is much more expensive to calculate. From an efficiency point of view, HID should be faster than Mahalanobis (however, probably at the cost of quality).

I am unfortunately not too much into Tamura Featues. Probably Franz Graf knows more about this. However often it makes sense to normalize the feature dimensions. If one dimension is in a range [0,100000] and all other dimensions are in range [0,1], than a single dimension will most likely dominate all other dimensions if you use Euclidean distance.

Cheers

Johannes

Franz Graf

unread,
Feb 27, 2015, 10:35:44 AM2/27/15
to jfeat...@googlegroups.com, Johannes Niedermayer
Hey there,

Thanks Johannes for answering. I am afraid that I cannot give much more details about Tamura features. I guess you will have to go a bit into literature about it.

Regards Franz
Dr. Franz Graf
http://www.Locked.de
Reply all
Reply to author
Forward
0 new messages