Ask Your Question
1

Percentage of color in a frame of video

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

viswanathk gravatar image

Hi!

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
1

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 http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html?highlight=histogram

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

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

Seen: 440 times

Last updated: Oct 02 '12