Friday, February 9, 2007

for capture

i captured some video to use for foreshortening calculating. the laptop and camera were on the 5th floor bridge of ap&m. ryan underwood watched the laptop while i went down and held up a green sign. there was a bit of wind, so the sign was hard to keep in a constant state.
i captured in ppm using this line:
ffmpeg -an -s 960x720 -vcodec ppm -f image2pipe foreshortening1.ppm
and converted the result to mp4 for viewing using this line:
ffmpeg -vcodec ppm -f image2pipe -i foreshortening1.ppm -vcodec mpeg4 foreshortening1.mp4
unfortunately the resulting video has skips in it and cuts off before the entire walk is done. it seems to have enough information to be usable. using this video we can count the number of pixels representing the poster and get a ratio for each y-line.
we should also be able to calculate this ratio if we know the height and distances and use 3d projection. i expect getting that information will be just as hard and more error prone.

here's the first video
and the second.

Monday, February 5, 2007

Ground truth and algorithms

On Saturday, Daniel and I worked on a couple of really important algorithms:
  1. An algorithm to combine blobs that are very close together/closely related--this is necessary to work around the poor performance of OpenCV's blob detection functionality in poor lighting conditions.
  2. An algorithm to track blobs across frames, assuming that algorithm 1 was run on each frame. This is so we can see the trajectory of people blobs towards different cars.
Speaking of people and car blobs, I also took some additional video on Saturday from the AP&M building (looking at the Faculty Club lot). Using Nick True's labeling program, I labeled several frames from that video. They're below:

groundtruth1.png
groundtruth2.png
groundtruth3.png

(car blobs are red, people blobs are green)

From the looks of things, car blobs and people blobs are extremely similar in size, at least from that vantage point. Simply looking at the size of each won't be enough, unless the sizes of each blob are clearly distinguishable. Perhaps we can track each blob and use its rate of movement to determine which category a particular blob belongs to.

Also, OpenCV's blob detection library seems slow for real-time use (70-90ms per frame according to gprof). For the time being, we won't worry about detecting in real-time.

Monday, January 29, 2007

movellan, guest, differences

i talked more with movellan last thursday. he's not as keen on working with us as he was before. he had been under the impression that we could work more directly on the robotics problem. he's encouraging though.
on friday i met with guest again. he gave me some code for ppm manipulation, like scaling.

i also washed my phone, so now it's even harder to talk with guest. he's more of a phone person and not so much on the email. we're going to meet again this friday. we were supposed to meet today, but he hasn't showed up.

our own code now has code for doing a diff from n frames ago, and for doing a running average difference. unfortunately video does not play on my laptop, so i'll have to test it later.

Wednesday, January 24, 2007

Blob detection library

I was Googling around and found a blob detection library that we can potentially use. The only thing is that it's written in Java; we'll need to port it to C first before we can try it with the video footage we've captured so far. The nice thing about Java is its similarity to C--there should be no problems porting it to the C language.

I'd also like to figure out what algorithm it's using, and compare it with the currently available algorithms out there. This will require reading the library code, though.

Friday, January 19, 2007

Video differences

We now have a video diff application. Here is a processed version of the clip posted previously. It looks pretty promising, and better than I expected. Right now, it compares all subsequent frames with the first frame captured from the camera, but we eventually want to diff from the previous frame instead (to account for changes in scenery/time of day).

The current code for the video diff program is on Subversion, at svn://svn.lifeafterking.org/cse190/videodiff/. To compile:
gcc -O2 -march=pentium4 -mtune=pentium4 -mmmx -g -o videodiff videodiff.c
To run:
ffmpeg -vcodec ppm -f image2pipe | ./videodiff | ffmpeg -vcodec pgm -f image2pipe -i - -vcodec mpeg4 [output file]
And there you have it. :)

Wednesday, January 17, 2007

Initial video capture

This was taken earlier this morning from the sixth floor of EBU1. Near the end of the video, it shows a van leaving a parking space and stopping in the middle of the parking lot. After, the driver gets out, puts something in the trunk, and gets back in. I preferred footage of someone walking to his/her car, but this works for the time being.

Anyways, off to class.

Tuesday, January 16, 2007

Initial footage from camera

So, it looks like the command for ffmpeg is actually incorrect with the version that I'm using. It should be:

ffmpeg -an -s 960x720 -vcodec ppm -f image2pipe test.ppm

or this for B&W:

ffmpeg -an -s 960x720 -vcodec pbm -f image2pipe test.pbm

(of course, replacing test.pbm/ppm with "-" to output to standard output)

Result (clicking on image goes to the full sized version):