Ask Your Question
0

mode value

asked 2014-07-01 02:18:00 -0600

bjarne gravatar image

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!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-01 03:04:10 -0600

Witek gravatar image
edit flag offensive delete link more

Comments

Hej Witek, thanks for your answer, but I think that the maxVal and Mode Value are not the same. When I use your approach, I will get the highest bin-value but not the amount of pixels for this bin

bjarne gravatar imagebjarne ( 2014-07-01 08:45:39 -0600 )edit

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.

Witek gravatar imageWitek ( 2014-07-01 10:04:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-01 02:18:00 -0600

Seen: 3,273 times

Last updated: Jul 01 '14