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,

i'm assuming your solution will probably perform much better since you're using the core image kernel. so how is the performance?
For the simple test I resampled the image from the iSight to 512x512 (that was just convenient for the way I wrote the algorithm) and then run separate centroid computations to track three colored balls and composite a different image on each of them. That runs at 30fps on an NVidia 6800 (I didn't really test how much headroom is left CPU/GPU- wise when that is running)

I hope this helps,
- Ralph



On Jun 11, 2005, at 8:47, Takashi Okamoto wrote:
hi ralph.

i took pol's advice and used QCView to bring the .qtz into xcode. i then used the output image from a patch as an NSImage. i then read out the pixel values using the NSImage, calculated the average position of a color and fed it back into a published input in the .qtz. the only thing i'm going to work on now is to build in some sort of color tolerance, but i don't really know much about NSColor. (does anybody know if there is a way of using isEqual: but somehow building in a tolerance?)

anyway, it works as expected, but performance isn't the greatest. as a sample i'm feeding a 400x300 quicktime movie @30fps, and it's pretty jumpy, so i'm only sampling every 30 pixels in the x and y; since i'm really going for a seemless realtime effect.

i'm assuming your solution will probably perform much better since you're using the core image kernel. so how is the performance?

-tak.

On Jun 10, 2005, at 7:17 PM, Ralph Brunner wrote:


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
References: 
 >Re: basic color tracking (From: Ralph Brunner <email@hidden>)
 >Re: basic color tracking (From: Takashi Okamoto <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.