Ask Your Question

tkd89's profile - activity

2019-10-08 04:20:50 -0600 received badge  Famous Question (source)
2017-05-29 16:54:57 -0600 received badge  Notable Question (source)
2015-10-13 08:42:38 -0600 received badge  Popular Question (source)
2013-04-29 12:21:43 -0600 received badge  Student (source)
2013-01-30 06:37:46 -0600 asked a question 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