mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 11:40:44 +08:00
fixed #1616
This commit is contained in:
parent
6636d255f7
commit
c9efcf8d1f
@ -1350,7 +1350,18 @@ void cv::calcBackProject( InputArrayOfArrays images, const vector<int>& channels
|
||||
const vector<float>& 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();
|
||||
|
Loading…
Reference in New Issue
Block a user