Hey, i was wondering what do the AS3 experts would do to detect a color with the webcam (red) and draw a sprite on those color boundaries.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can access the pixel data in BitMap (Or more correctly, the associated BitMapData) to write your own filter, or you could use a BitmapFilter.
You should be able to capture a bitmap from the webcam by drawing Video to a bitmap you create (use draw() to draw the current video image).
So this should get you a bitmap and a way of detecting pixels in it. Now you can change the bitmap to add your own graphics (or put them in a sprite that is on top of the bitmap). Show the bitmap on screen after you’ve changed it, and repeat this for every frame 🙂
See http://www.kasperkamperman.com/blog/flash-code/as3-apply-bitmap-filters-to-a-webcam-image/ for some inspiration.