Ask Your Question
1

How to determine if image contains object of certain color

asked 2013-08-13 13:01:48 -0600

silvox gravatar image

updated 2014-02-20 05:56:30 -0600

berak gravatar image

Hey - I am very new to opencv, and learning as I go. How would one determine if an image contains an object within a certain color range, i.e. determine if an image contains a green ball in python?

edit retag flag offensive close merge delete

Comments

1

http://www.aishack.in/2010/07/tracking-colored-objects-in-opencv/ (C++) http://aravindc.com/2012/12/26/color-tracking-opencv-python-and-my-first-post/ https://bradmontgomery.net/blog/2008/01/24/tracking-a-laser-pointer-with-python-and-opencv/

That first one is a nice C++ tutorial, google around for a better python example. But basically you'll want to convert video frames from RGB color space to HSV color space. Then you can easily threshold the images to show only pixels that fit some desired Hue range.

rbertc gravatar imagerbertc ( 2013-08-13 14:40:00 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-20 05:54:36 -0600

prakharmohan gravatar image

The link provided here might help you. Note that you can also edit the threshold according tot he shade of green and the "purity" according to your use.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-08-13 13:01:48 -0600

Seen: 3,229 times

Last updated: Feb 20 '14