mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 21:33:04 +04:00
Fix an arg for calcHist() in demos
`float* histRange = { range };` doesn't make much sense. `histRange` is
an array of array(s), so it should have a type of ptr to ptr. Strangely
some domos are correct as well as the example for the function
https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga4b2b5fd75503ff9e6844cc4dcdaed35d
This commit is contained in:
@@ -72,18 +72,18 @@ void Hist_and_Backproj(int, void* )
|
||||
//! [initialize]
|
||||
int histSize = MAX( bins, 2 );
|
||||
float hue_range[] = { 0, 180 };
|
||||
const float* ranges = { hue_range };
|
||||
const float* ranges[] = { hue_range };
|
||||
//! [initialize]
|
||||
|
||||
//! [Get the Histogram and normalize it]
|
||||
Mat hist;
|
||||
calcHist( &hue, 1, 0, Mat(), hist, 1, &histSize, &ranges, true, false );
|
||||
calcHist( &hue, 1, 0, Mat(), hist, 1, &histSize, ranges, true, false );
|
||||
normalize( hist, hist, 0, 255, NORM_MINMAX, -1, Mat() );
|
||||
//! [Get the Histogram and normalize it]
|
||||
|
||||
//! [Get Backprojection]
|
||||
Mat backproj;
|
||||
calcBackProject( &hue, 1, 0, hist, backproj, &ranges, 1, true );
|
||||
calcBackProject( &hue, 1, 0, hist, backproj, ranges, 1, true );
|
||||
//! [Get Backprojection]
|
||||
|
||||
//! [Draw the backproj]
|
||||
|
||||
Reference in New Issue
Block a user