Tuesday, August 27, 2019

image processing - 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:


enter image description here


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<=11; j++) {

float result = sqrt(pow(featurestest[j]-features[j],2));
if (result > 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).




No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...