From: Alexander Shishkov Date: Wed, 28 Mar 2012 15:12:12 +0000 (+0000) Subject: fixed #1616 X-Git-Tag: accepted/2.0/20130307.220821~952 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9efcf8d1fd5e520d42bd4b247c36e9bc8b2d60e;p=profile%2Fivi%2Fopencv.git fixed #1616 --- diff --git a/modules/imgproc/src/histogram.cpp b/modules/imgproc/src/histogram.cpp index 960a26f..546c215 100644 --- a/modules/imgproc/src/histogram.cpp +++ b/modules/imgproc/src/histogram.cpp @@ -1350,7 +1350,18 @@ void cv::calcBackProject( InputArrayOfArrays images, const vector& channels const vector& ranges, double scale ) { - Mat H = hist.getMat(); + Mat H0 = hist.getMat(), H; + int hcn = H0.channels(); + if( hcn > 1 ) + { + CV_Assert( H0.isContinuous() ); + int hsz[CV_CN_MAX+1]; + memcpy(hsz, &H0.size[0], H0.dims*sizeof(hsz[0])); + hsz[H0.dims] = hcn; + H = Mat(H0.dims+1, hsz, H0.depth(), H0.data); + } + else + H = H0; bool _1d = H.rows == 1 || H.cols == 1; int i, dims = H.dims, rsz = (int)ranges.size(), csz = (int)channels.size(); int nimages = (int)images.total();