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!
You need:
You need:
You need:
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".