[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Tracking colors

dongie.agnir

1/9/2008 7:25:00 AM

I'm just getting started with Python, and I want to do a bit of color
tracking using VideoCapture. However, I've never worked with video or
images, so I'm a little at a loss. How would I use VideoCapture to
track a specified color, and its coordinates?
2 Answers

Tim Roberts

1/10/2008 6:50:00 AM

0

dongie.agnir@gmail.com wrote:
>
>I'm just getting started with Python, and I want to do a bit of color
>tracking using VideoCapture. However, I've never worked with video or
>images, so I'm a little at a loss. How would I use VideoCapture to
>track a specified color, and its coordinates?

There's really no easy way to do this. You'll have to convert the image to
an array of pixels, then search through them to find a block of the color
you're interested in. Remember that camera sensors are real-world devices,
so the actual pixel values vary slightly from frame to frame. You'll have
to look for a range.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Dennis Lee Bieber

1/11/2008 6:36:00 AM

0

On Thu, 10 Jan 2008 06:49:43 GMT, Tim Roberts <timr@probo.com> declaimed
the following in comp.lang.python:

> There's really no easy way to do this. You'll have to convert the image to
> an array of pixels, then search through them to find a block of the color
> you're interested in. Remember that camera sensors are real-world devices,
> so the actual pixel values vary slightly from frame to frame. You'll have
> to look for a range.

Finding the color in the first frame may take a long time...
Tracking it from frame to frame, as long as the marker color doesn't
move extremely fast, might be done by creating a mask of frame
differences... Then, since you already know the previous coordinates of
the markers, only examine colors in the regions identified by the
difference mask.
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-asst@bestiaria.com)
HTTP://www.bestiaria.com/