Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

replace the following lines in your code:

double maxVal=0;
minMaxLoc(hist, 0, &maxVal, 0, 0);
cout << "highest Hue value: " << maxVal << endl;

with this:

double maxVal=0;
Point maxLoc;
cv::minMaxLoc(hist, 0, &maxVal, 0, &maxLoc);
cout << "highest Hue value: " << maxVal << "at the " << maxLoc.y << " bin."  endl; // maxLoc.y shows you in which bin you have the most of your pixels values

replace the following lines in your code:

double maxVal=0;
minMaxLoc(hist, 0, &maxVal, 0, 0);
cout << "highest Hue value: " << maxVal << endl;

with this:

double maxVal=0;
Point maxLoc;
cv::minMaxLoc(hist, 0, &maxVal, 0, &maxLoc);
cout << "highest Hue value: " << maxVal << "at the " << maxLoc.y << " bin."  << endl; // maxLoc.y shows you in which bin you have the most of your pixels values