Tracing the movements a moving object on video - How to do it?

Discussion in 'Digital Video' started by dllavaneras, Jan 1, 2009.

  1. dllavaneras macrumors 68000

    dllavaneras

    Joined:
    Feb 12, 2005
    Location:
    Caracas, Venezuela
    #1
    Hey everyone!

    I'm setting up a behavior experiment with some insects. The insects are going to be in a 30x20x30 cm glass box, and I'll film them from above. One of the objectives is to register the total distance of the insect's movement during the length of the experiment.

    Is there a way I can track the movements of the insect? I was thinking of something along the lines of placing a layer on top of the video, and following the movement with my mouse, which would leave a line. At the end of the video, that would leave me with an image that can be imported into Photoshop and the line measured with the ruler tool. Like this:

    [​IMG]

    1 would be the glass box, 2 would be the insect and the traced route, and 3 would be the image imported into PS CS3 and measured. The scale would be easy to get, since I just input the number of pixels that the 30 cm side measures and set my scale.

    BTW, the ruler tool only lets me measure the distance from point A to point B. Is there any way I can measure the whole route in one motion? I'd hate to have to add all the different lengths.

    Tools I have available: Photoshop CS3, Final Cut Express.
     
  2. DPA macrumors 65816

    DPA

    #2
    There is a motion tracking thing in Motion which is part of Final Cut Studio. I'm pretty sure you can't track motion in FCE. There is a motion tracking plugin for FCE that's $49. You can also download the demo which you would have enough time in the demo to do what you want. By tracking the motion, you can export it as a JPEG I think.

    Happy New Year,
    David
     
  3. dllavaneras thread starter macrumors 68000

    dllavaneras

    Joined:
    Feb 12, 2005
    Location:
    Caracas, Venezuela
    #3
    Thanks for the link! I was reading through the descriptions, and it seems that it can track the motion of an object, but not trace its position (and change thereof) for the whole clip.

    There's another way to do it, but it's a real pain. It'd be to take the video, see where the motion starts and stops and extract an image from every point where the insect starts, stops or changes direction. I'd then import all those images into Photoshop as different layers and do the motion route thing myself.

    It's painstakingly slow, and seeing that I'll have about 60 hours of video to analyze, I'm not a big fan of the idea. :(
     
  4. Martster macrumors newbie

    Joined:
    Feb 9, 2008
    Location:
    Van Diemen's Land
    #4
    processing

    I dont know if you have any experience programming, but an approach that would fully automate the process is possible using the open source environment called 'Processing'. Its free and java based, and similar projects have been developed using its video and motion tracking libraries. It should be possible to track the ant from frame to frame, whilst calculating distance also.
    Its a fair amount of work if you only need to do it once though. :eek:

    cheers and new years!
    Mart

    check these out

    http://www.v3ga.net/processing/BlobDetection/
    http://processing.org/reference/libraries/video/index.html
    http://www.whiteglovetracking.com/
     
  5. dllavaneras thread starter macrumors 68000

    dllavaneras

    Joined:
    Feb 12, 2005
    Location:
    Caracas, Venezuela
    #5
    I have less than no experience programming (other than setting the time on the microwave), sadly. :(

    One of your examples caught my eye, the video in whiteglovetracking.com. The third example, Flocking Gloves, is kind of what I had in mind. The movements won't overlap so much, and all I need is a simple line that tracks motion.
     

Share This Page