A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: webcam tracking + generating random lines (as3)

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    3

    webcam tracking + generating random lines (as3)

    Hi all. I'm trying to write code for webcam tracking + drawing generative lines. Main idea is that person passes the camera and it creates random size and colours lines. After lines fill screen up to 35%, screen become blank (as in the begining).
    So my questions are:
    1. how to create random size and colours lines that appears by person tracked movement? (example could be that person is creating generative art by lines)
    2. what functions should I use to count percents of filled screen? (I want that after 35% screen become blank as in the beginning. After that it just continue process from the beginning)
    Thank you in advance.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Make up your mind. Do you want the lines to be random, or controlled by the movement?

    For the second part, you can draw into an initially empty screen sized bitmap, and use BitmapData.threshold to count empty pixels.

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Quote Originally Posted by 5TonsOfFlax View Post
    Make up your mind. Do you want the lines to be random, or controlled by the movement?
    Controlled by the movement..

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Then you will have to analyze the actual data. What is your idea for how the movement controls the lines?

    The easiest thing to do is probably to subtract one frame from the previous, which will tell you the changed pixels. You can take that information and use it to try to get directions.

    Or you could use existing computer vision packages. ASSURF provides some really interesting features, including automatic feature detection and motion estimation.

    Deface and Marilena can detect faces. Once you have an object to track, you can use things such as meanshift and camshift to track that object across frames.

    Or you could try to port (or use through alchemy) another package such as the Predator tracker: http://info.ee.surrey.ac.uk/Personal/Z.Kalal/

  5. #5
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Main idea is that people passing the camera create some peace of generative art. I was tihniking that they create lines that are connected between tracked points. Also it would be great if it could be different types of lines: different colours, sizes and growing speed..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center