From: Antonio on
Hi,

Just read this post and was wondering if there are ant functions within Matlab that can compute the mode or mean of multiple frames over time.

I have tried a simple for loop (mean calculation) from an earlier post, using imadd, whereby each frame is read in and added to an imtoal (running total) and then divided by teh mumber of frames, but I get the error message

"index exceeds matrix dimensions".

The code I am using is below....

imtotal = double(IM{1});

for i = 2:length(IM)
imtotal = imadd( imtotal, double(IM{i}) );
end

What I am basically trying to do is generate the best reference frame (background frame) of a static camera tracking cars on a motoroway. None of the frames contain a static image (there are always car's in the image) and so I wanted to calculate the average value of a pixel at its respective coordinates over all frames to generate a ref frame.

Unfortunately, I am new to MATLAB and so any help would be much appreciated.

Many Thanks

ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <179440ea-62db-4301-942a-bff1c1e25cab(a)m26g2000yqb.googlegroups.com>...
> Jim:
> Another option: just take the mode of all the frames.
> Assuming that your moving object doesn't spend the majority of time
> covering a pixel, then the mode would give you the background. If you
> want, you could do a second pass where you take the mean if the pixel
> value is close enough to the mode (meaning you're just looking at the
> background and it has regular video noise on it). If the pixel value
> is not close to the mode, then the object is there and you'd want to
> ignore it.
>
> If you want something fancier and more sophisticated, take a look at
> this:
> http://www.mee.tcd.ie/~sigmedia/Research/RigRemoval
> It can handle moving backgrounds.
> Regards,
> ImageAnalyst
 | 
Pages: 1
Prev: Edge Detection
Next: symbolic array into double