Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you use CV_COMP_INTERSECT comparison method on two histograms that are perfectly match, your result will be equal to sum of values of a histogram. i.e. your result will be equal to L1 norm of histogram.

When you used normalize() function, you set only 3 first parameters. And so other parameters were used with their default values. By default it uses L2 norm. i.e. after using normalize(), sum of squares of values of histogram was set to 1.

To fix your problem you should use:

cv::normalize(histogram, histogram, 1.0, 0.0, NORM_L1);