Commit e7995b4d authored by ericgreveson's avatar ericgreveson

Take account of multi-channel matrices when comparing histograms

Ensure that all channels are considered when comparing multi-channel histograms
parent 19794e68
...@@ -1980,7 +1980,7 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method ) ...@@ -1980,7 +1980,7 @@ double cv::compareHist( InputArray _H1, InputArray _H2, int method )
{ {
const float* h1 = (const float*)it.planes[0].data; const float* h1 = (const float*)it.planes[0].data;
const float* h2 = (const float*)it.planes[1].data; const float* h2 = (const float*)it.planes[1].data;
len = it.planes[0].rows*it.planes[0].cols; len = it.planes[0].rows*it.planes[0].cols*H1.channels();
if( method == CV_COMP_CHISQR ) if( method == CV_COMP_CHISQR )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment