Ask Your Question

Percentage of color in a frame of video

asked 2012-09-17 07:54:28 -0500

viswanathk gravatar image


I am trying to write a program that measures the percentage of black in the input taken from the webcam. How can I do this? I was thinking I should use histograms but have no idea on how to use it. Can you help me?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-09-17 09:11:50 -0500

unxnut gravatar image

updated 2012-10-02 05:35:38 -0500

V.G. gravatar image

If you want to use histogram, you will need to get a histogram of monochrome frame by converting the image to grayscale. Or you can convert the image to HSV and compute the histogram of V component.

A tutorial on histograms is available in the documentation at

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2012-09-17 07:54:28 -0500

Seen: 414 times

Last updated: Oct 02 '12