|
|
@ -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) |
|
|
|
|
|
|
|
|
|
|
|
//! [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]
|
|
|
|