CalcHist throw expection (Bug #2241)
Description
Hi all:
My operation os:windows 7 x64 using opencv x86.
I using below list,it works well.
1calcHist(&c1,1,0,Mat(),hist,1,&histSize,&histRange,true,true);
But I change ninth parameters from "true" to "flase", then throw expection.
1calcHist(&c1,1,0,Mat(),hist,1,&histSize,&histRange,false,true);
Associated revisions
Merge pull request #2241 from asmorkalov:ocv_highgui_test_output_fix
History
Updated by wuling Chang over 12 years ago
Hi
There are some different in opencv2refman.pdf & opencv_tutorials.pdf.
In opencv2refman page 274, where example:
1MatND hist;
2// we compute the histogram from the 0-th and 1-st channels
3int channels[] = {0, 1};
4calcHist( &hsv, 1, channels, Mat(), // do not use mask
5hist, 2, histSize, ranges,
6true, // the histogram is uniform
7false );
In opencv_tutorials.pdf page 215,example:
1Mat b_hist, g_hist, r_hist;
2
3//Compute the histograms:
4calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
5calcHist( &bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, &histRange, uniform, accumulate );
6calcHist( &bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, &histRange, uniform, accumulate );
I am so confused to declare variable.
Updated by Marina Kolpakova over 12 years ago
Did you change histRanges
according to not uniforme case usage?
If you use uniform variant of function your range should contain only lower bound for 0-bin and upper bound for last bin. So it's 2 values for each dimension. But for not uniform variant you should specify lower and upper bounds for each bin for each dimension.
- Description changed from Hi all: My operation os:windows 7 x64 using opencv x86. I using below list,i... to Hi all: My operation os:windows 7 x64 using opencv x86. I using below list,i... More
- Category set to imgproc, video
Updated by wuling Chang over 12 years ago
Hi ,
dear Marina,
I think i am wrong. I don't change histRanges,I try again and
Mat b_hist, g_hist, r_hist; //just for one channel
MatND hist; //for muti-channels
Thanks.
Updated by Marina Kolpakova over 12 years ago
- Target version set to 2.4.3
- Status changed from Open to Cancelled