View Full Version : program for tracking and centering objects in videos
happyvideo
20th April 2011, 17:07
Hi All!
I've programmed a little tool to track and center single objects of a certain color in videos. The program creates an AVS file which can then be used with VirtualDub. Here's an example video:
http://www.youtube.com/watch?v=2jJw7-Siles
what do you think? You can download the software here:
http://videocrack.npage.de/ (click centertracker on the left, then download)
Cheers
Stephan
edit 28.04.11:
version 1.3 now available (see link above)
pbristow
25th April 2011, 11:09
I see this is your first post, so welcome to the family! :) I hope my comments don't seem too harsh.
Initial impression: I'm confused. Why do you need a program to create an AVS file for this? Once you've created the first AVS file (which I presume is using depan or similar plug-ins), which can be done by hand (and you'd presumably need to have done that at least once to work out what your program needed to do), why not just re-use that script and tweak the parameters as needed for each job?
Also, the link seems to go to a half-built webpage, which at first sight made me think this was a spam advert for the service provider! (Luckily, I then spotted the CentreTracker link at the bottom of the list).
Being a brave soul (and checking my anti-virus software was turned fully on), I downloaded the mysterious centertracker.zip file, scanned it, then unzipped it, then scanned again. No booby traps. So far so good...
Inside the file are an exe file, several dlls, an icon and an info.txt file. Opening this last one, I find a long list of instructions, most of which involve steps taken outside of CentreTracker using other tools.
Reading between the lines, what CentreTracker does is basically provide a GUI for selecting an area of a still frame, detecting the dominant colour in that area, and generating some parameters to feed into a script.
Now, if I could feed a video clip directly to it and just scroll to the right frame (rather than having to extract a still frame first), then I can see a "zone-limited colour analyser" like this being really useful, e.g. for setting up chromakey ("green screen") effects, etc. Narrowing it down to just one specific job - setting up a script for tracking & centering the chosen object - seems like wasted potential, since I can't imagine when I would ever want to do that! :)
It might help if you tell us more here about your program, and why you created it. Maybe I'm overlooking something.
happyvideo
26th April 2011, 08:59
Hi pbristow,
thx for the welcome and for your review. Yep, you mention some good points.
In fact I'm working on feeding a video clip into it to scroll for the right frame. And this already works for uncompressed avi files. However, most avis are compressed, with XviD for example. And in that case my (only a few weeks old) C++ / OpenCV knowledge fails to make the cvQueryFrame command work properly (there are shown only two frames (like the 1st and the 300th). I'm also working on making it more user-friendly, i.e. to let the user choose the files from a list instead of entering them manually.
I think the main reason why I created this tool was to center objects in the middle of the screen because I often end up with videos (camcorder) that are shaky and not centered.
The advantage of using this soft (imo) is that if you narrow the colors good enough you can get quite unshaky results. The only precondition is that the object's colors should be different from the background or other objects as otherwise it won't work (so it's good for objects in the sky or objects that have a distinct color). My last two experiments returned a better result than before (when I used other tools):
http://www.youtube.com/watch?v=Z7IFlxnp5Mw
http://www.youtube.com/watch?v=nrUNPTSagJ4
there are of course still things that could be improved, like the black frames (where colors were not detected). But I've already got a solution for that and it will be included in the next version.
Cheers
Stephan
edit: the AVS file is fed with x and y coordinates via ConditionalReader. The coordinates are created by the program and stored in two separate txt files. The method itself is based on color tracking
edit2: said feature added to v1.3, here's a tutorial vid:
http://www.youtube.com/watch?v=4gFAKYaj_58
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.