How can i add all 'R' values in the image?
I need to add all the R values in the image . How can i do this?
there's a builtin sum function for that:
e.g. if you have a (bgr) image:
Mat img = imread("my.png");
Scalar s = sum(img);
//s[0] = sum of blue channel,
//s[1] = sum of green channel,
//s[2] = sum of red channel,
Asked: 2015-01-07 03:58:10 -0600
Seen: 831 times
Last updated: Jan 07 '15