提交 04d5ba26 编写于 作者: A Alexander Alekhin

Merge pull request #20330 from Wovchena:fix-arg-for-calcHist-in-demos

...@@ -89,7 +89,7 @@ void MatchingMethod( int, void* ) ...@@ -89,7 +89,7 @@ void MatchingMethod( int, void* )
//! [create_result_matrix] //! [create_result_matrix]
/// Create the result matrix /// Create the result matrix
int result_cols = img.cols - templ.cols + 1; int result_cols = img.cols - templ.cols + 1;
int result_rows = img.rows - templ.rows + 1; int result_rows = img.rows - templ.rows + 1;
result.create( result_rows, result_cols, CV_32FC1 ); result.create( result_rows, result_cols, CV_32FC1 );
......
...@@ -72,18 +72,18 @@ void Hist_and_Backproj(int, void* ) ...@@ -72,18 +72,18 @@ void Hist_and_Backproj(int, void* )
//! [initialize] //! [initialize]
int histSize = MAX( bins, 2 ); int histSize = MAX( bins, 2 );
float hue_range[] = { 0, 180 }; float hue_range[] = { 0, 180 };
const float* ranges = { hue_range }; const float* ranges[] = { hue_range };
//! [initialize] //! [initialize]
//! [Get the Histogram and normalize it] //! [Get the Histogram and normalize it]
Mat hist; 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() ); normalize( hist, hist, 0, 255, NORM_MINMAX, -1, Mat() );
//! [Get the Histogram and normalize it] //! [Get the Histogram and normalize it]
//! [Get Backprojection] //! [Get Backprojection]
Mat backproj; Mat backproj;
calcBackProject( &hue, 1, 0, hist, backproj, &ranges, 1, true ); calcBackProject( &hue, 1, 0, hist, backproj, ranges, 1, true );
//! [Get Backprojection] //! [Get Backprojection]
//! [Draw the backproj] //! [Draw the backproj]
......
...@@ -37,7 +37,7 @@ int main(int argc, char** argv) ...@@ -37,7 +37,7 @@ int main(int argc, char** argv)
//! [Set the ranges ( for B,G,R) )] //! [Set the ranges ( for B,G,R) )]
float range[] = { 0, 256 }; //the upper boundary is exclusive float range[] = { 0, 256 }; //the upper boundary is exclusive
const float* histRange = { range }; const float* histRange[] = { range };
//! [Set the ranges ( for B,G,R) )] //! [Set the ranges ( for B,G,R) )]
//! [Set histogram param] //! [Set histogram param]
...@@ -46,9 +46,9 @@ int main(int argc, char** argv) ...@@ -46,9 +46,9 @@ int main(int argc, char** argv)
//! [Compute the histograms] //! [Compute the histograms]
Mat b_hist, g_hist, r_hist; Mat b_hist, g_hist, r_hist;
calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate ); calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, histRange, uniform, accumulate );
calcHist( &bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, &histRange, uniform, accumulate ); calcHist( &bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, histRange, uniform, accumulate );
calcHist( &bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, &histRange, uniform, accumulate ); calcHist( &bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, histRange, uniform, accumulate );
//! [Compute the histograms] //! [Compute the histograms]
//! [Draw the histograms for B, G and R] //! [Draw the histograms for B, G and R]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册