This is just a collection of software and other useful things for people in the lab.

Avi reading example code

Note: since AVI - Audio Video Interleave - format is not a complete format, in the sense that it describes the way to INTERLEAVE chunks of audio and video data BUT DOES NOT say what the coding format of those chunks is (e.g., MPEG, ZIPPED, UNCOMPRESSED), it really doesn't make complete sense to say "how do I read in an AVI file?" because you also need a CODEC to understand the chunks.

Directshow has a way of trying to find the correct codec, this is complicated to use when it should be simple!!

Anyway, the example code here uses the older VFW (NOT DRIECTSHOW) interface to the avi file reader and therefore doesn't read DV encoded AVI (or most other - for that matter!)

If you want to use AVI files that are encoded - get a video editor or someother way of converting to uncompressed first!

AVI to pgms

Reads in an avifile and outputs images as pgms one per frame.

You need:

avitopgms.c

avitopgms.h

VC makefile

AVI to ppms

Reads in an avifile and outputs images as ppms one per frame.

You need:

avitoppms.c

avitoppms.h

AVI - read in and average so as to get background only

Reads in an avifile and, for each pixel, time averages it (actually trimmed mean to remove outliers) - this is one simple way to try to remove a moving object and leave the background.

You need:

aviread.c

aviread.h

VC makefile

To run, you type aviread name_of_avi . You are then asked for how many pixels to slice off the end of the sorted pixels to perform the trimmed mean - and also for the start and end frame number.

You need a (B/W) image sequence - you can try: stevebw.avi

Note: this is an image sequence Raj used for his thesis on image tracking. Actually, he "cheated" in that the first frame is the blank background captured before the person was placed in the frame.

Try running with 2 as start frame, 90 as end frame, and 30 pixels dropped from each end, then try with other numbers. Note: the output is always called background.pgm.

Of course, this isn't the best way to extract the background - who knows what is - but it is nice example code that "works".