Good afternoon, folks,
I have a .bmp image and I want to turn it to grayscale (0-255) through Opencv with C ++ (I do not want to save this grayscale image). From here, I want to go through the image doing the following:
For each pixel, if the grayscale is between 0-31, then this pixel belongs to class 1. If it is between 32-63 then this pixel belongs to class 2 ... and so it goes. We will thus have 8 classes.
Then I want to know how many pixels are in class 1, 2, 3, ..., 8.
How can I do this? I searched the Opencv documentation but could not find anything that would help me.
Thank you very much!