hi, i want to find red green and blue percentage in an image. i used the following code which shows 0%age for the red. help to improve my code.
below is code :
vector<mat> channels; split(hsv_img,channels);
Mat red, blue, green; inRange(channels[0], Scalar(0), Scalar(10), red); // red // ... do the same for blue, green, etc only changing the Scalar values and the Mat
double image_size = hsv_img.cols*hsv_img.rows; double red_percent = ((double) cv::countNonZero(red))/image_size;
what shoud i change in scalar to have green and blue value.
thanks !!