Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

please use meanStdDev() to find the average pixel value of your ROI, DO NOT WRITE YOUR OWN LOOPS !

Mat roi = img(selectRect);
Scalar m,s;
meanStdDev(roi, m, s);
double avgPixel = m[0];