Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

compareHist problem, type != CV_32F

as in title, when i'm trying compare two histograms which are cv::MatND type and obtained by:

cv::calcHist(&image,
             1,             // histogram of 1 image only
             channels,      // the channel used
             cv::Mat(),     // no mask is used
             hist_rgb,      // the resulting histogram
             3,             // it is a 3D histogram
             histSize,      // number of bins
             ranges,        // pixel value range
             true,
             false);

and normalized by:

cv::normalize( hist_temp, hist_rgb, 1.0, 0.0, cv::NORM_L1 );

i have the following error:

OpenCV/OpenCV-2.4.3/modules/imgproc/src/histogram.cpp:1399: error: (-215) H1.type() == H2.type() && H1.type() == CV_32F in function compareHist

i check above two conditions and the problem is in: H1.type() == CV_32F, but i don't know how to fix it