[Etoys] [FUN]Track color with camera

Bert Freudenberg bert at freudenbergs.de
Wed Feb 6 09:26:15 EST 2008


On Feb 6, 2008, at 15:03 , Karl wrote:

> Bert Freudenberg wrote:
>> On Feb 4, 2008, at 21:31 , karl wrote:
>>
>>> I have used Wiebe Barons WebCamMorph and added some Etoy support  
>>> to it. It is possible to track a color with the camera and a  
>>> ellipse on the screen reflect the movement. I'll see if I can  
>>> make it into a input feature like the eyeToy to the Playstation2.  
>>> Enjoy
>>
>> Not bad :) Here's a project version of this:
>>
>> http://dev.laptop.org/~bert/camTrack.pr
>>
>> Works nicely on the XO (if you have good lighting and a distinctly  
>> colored shape) ...
>>
>> - Bert -
>>
>>
> Cool.
> I tinkered a little more with this and added a setting for how many  
> points should be scanned each scan. That fewer scanned points made  
> morphic more responsive but jumpier movement of the ellipse. Next  
> change will be to just return x and y values so any object can be  
> hooked up to input.
>
> Future enhancement is:
>    - several colors scanned for, that would enable more advanced  
> input like one for mouse click simulation and one for movement.
>    -putting scanning in a primitive would really speed up  
> everything and make even more stuff possible, like gestures, sign  
> language ? etc.

You might try (ab-)using BitBlt for this - for example, convert to 16  
bit, then use a 32k entry tolerant color map to convert to b/w, then  
use #innerPixelRectFor:orNot: or #rectangleEnclosingPixelsNotOfColor:  
to find the rectangle enclosing the object ... Or with WarpBlt and  
smoothing you can reduce the image size while retaining colors ...

- Bert -



More information about the Etoys mailing list