I am working on a CBIR (Content-based Image Retrieval) project that will draw a histogram of RGB images, as well as calculate the distance between other images using a query image.
I am using VS 2008 - MFC and OpenCV Library. The method I wanted to use to calculate the distance is Euclidean distance (ED), but somehow I could not handle it.
I found a function - cvCalcEMD2 (), which can help me calculate the distance between two histograms. To use this function, I need to create a signature for my histogram.
Here is an example for creating a signature that I found
in the For loop there is a line in which I need to pass my histogram:
float bin_val = cvQueryHistValue_2D (hist1, h, s);
and in my histogram function there is nothing like the variable h_bins and s_bins
In my program, I calculate / draw a histogram in R, G, and B. So each image has 3 histograms. for example: CvHistogram * hist_red, * hist_green, * hist_blue;
How to use my histogram to create a signature?
* link to my drawHistogram function is given in my comment below
source
share