mode value
Hey..I'm new in opencv and have to compute the mode value of an grayscale image in opencv and c++. I have searched the internet for examples, but havnt found. Anyone have an idea how can i make it? Thank you!!
Hey..I'm new in opencv and have to compute the mode value of an grayscale image in opencv and c++. I have searched the internet for examples, but havnt found. Anyone have an idea how can i make it? Thank you!!
Calculate the histogram of your image and find its biggest value.
If mode value is the most often appearing one, then the max value of the histogram if the mode value. The highest bin value will have the number of pixels of particular brightness (assuming you make your bins 1 pixel wide) that appear most often in the image. I think this is exactly what you are looking for.
Asked: 2014-07-01 02:18:00 -0600
Seen: 3,263 times
Last updated: Jul 01 '14