Haralick features, am I approaching this correctly? I'm trying to personalise a custom CBIR by adding more features not only based on colour, but based on textures' features.

What I don't know is if I'm approaching this well with Haralick's features.

I'm doing this:

I've used 10 images, 8 for different "textures" and 2 for tests:



All px.jpg are sand images, and all rx.jpg are squares. The test image is squares and test2 image is sand. (NOTE, I don't want to classify, I want a value for each image).

Well, when I query the image test (squares) on the rest of the images (r1, r2, r3, r4, p1, p2, p3, p4) I got the Haralick's features such as Angular 2nd moment, Contrast, Correlation... but I can't find a relationship with the squares, or a not-relationship with sand. I'm making a euclidean distance in this case:

    double features[15]; // I'm introducing other things as well
    Haralick h;
    h.CalculateCoocurrenceMatrix(features);
    correlation();

    for (int j = 1; j&lt;=11; j++) {
        float result = sqrt(pow(featurestest[j]-features[j],2));
        if (result &gt; f_max[j]) {
            f_max[j] = result; // to normalize later
        }

        jsonFeatures["F"+to_string(j)] = result;
    }


My question is: am I doing this approach well? if not, how should I do it?

Thank you in advance.



EDIT:
If it wasn't clear, I don't want to classify such like I'm doing in the example. I'm using "sand" and "squares" only to make the results more visually when sorting (for example seeing p1 p2 r1 p3 p4 r2 p5 r3 r4 r5 on the final match feature).
Using the Euclidean distance on a feature space will eventually result in a Minimum Distance Classifier which would provide information on the existence or not of a relationship that you seem to be after (for more information please see: http://homepages.inf.ed.ac.uk/rbf/HIPR2/classify.htm). 

In your case, if you are using all Haralick features, you are looking at a 13-14 dimensional feature space and a decision boundary that is not a line any more but a plane.

The usual way to do this is to first calculate the "class centroids", that is, the mean values of each feature for each set of sand and checker board images and then, given the features of the test image, calculate its distance from the centroids of each class and select the minimum (i.e. the class centroid that the test-image features are more closely to).

Hope this helps.