Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basic color tracking



Hi,

On Jun 5, 2005, at 12:29 PM, Takashi Okamoto wrote:
i was hoping to get some direction on how i can get some basic
color tracking done in qc. i have a video source (for testing i
just have a quicktime movie of a red dot moving around in a black
background) and i just want to get the (x,y) coordinate of the
center of the dot at each frame. i've done this in the past with
processing <http://processing.org> by adding all (x,y) positions
that are red and dividing it by the number of red pixels.

will i be able to do this in QC? i see that i can use the core
image kernel patch to get color values, but i don't know how i can
add the (x,y) coordinates and return the result every time it sees
a red pixel.

any suggestions will be greatly appreciated. thanks!

-tak.

Actually, there is a sneaky way to make this work -- you can write an Image Unit that does the color tracking (Quartz Composer automatically hosts the installed Image Units), and the output of that Image Unit is a single-pixel size image. That image contains the found x coordinate in the red, and the y coordinate in the green component, for example.


Then use that single pixel image and pipe it into a different kernel that does something interesting with it .. for example composite a crosshair image at the found location.

It's somewhat limiting, but I got it to work :)
- Ralph


_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.