From: sW on
HI

I have a project to complete!

I could read the files from a video clip using mmread. I tried with
the MMREADER, but every time code returned error messages.

Now with MMREAD or with AVIINFO, I can see the frame numbers of the
video. AVIINFO reads AVI files only.

Anyway, both of these funtions returns the number of frames.

I need to compare differences between the frames. The proces should
be as follow:
1. We shall start with the first frame of the video, it is the
reference frame.
2. Compare the second frame with the first frame.
3. Compare consequent frames to find which frame has got maximum
differences.
4. Now we take the new frame that shows coperatively more difference
with the first, initial frame.
5. Repeat the above mentione process to find new reference frames.

6. Keep all the 'selected' frames.
7. recreate the movie using MATLAB functions

I am facing the problem at the measuring the differences. The images
are of M-by-N-by-3 dimension, and formatted in UINT8. Measuring their
difference and keeping the values in some sink are difficult.

How can I solve this problem?
From: David Young on
sW <sajjad302(a)gmail.com> wrote in message <630aae4a-cb67-485d-b6dc-98f81ce48db0(a)l31g2000yqm.googlegroups.com>...

> I am facing the problem at the measuring the differences. The images
> are of M-by-N-by-3 dimension, and formatted in UINT8. Measuring their
> difference and keeping the values in some sink are difficult.
>
> How can I solve this problem?

The first step is to define what you mean by the difference between two images. I think that step is up to you - if you can say what you mean by the difference, it might be possible to help with the programming.

Bear in mind that a measure of the difference should probably be a real, non-negative scalar, which needs to be computed as a function of the image arrays. You might want to try several possibilities to see what works best, but the first thing is to think of at least one plausible measure.
From: sW on
> The first step is to define what you mean by the difference between two images.

-- The difference could be normal differences or mean square
difference. But with MSE, the calculation is complex . . . maybe I
did it in a wrong way.

> I think that step is up to you - if you can say what you mean by the difference, it might be possible to help with the programming.

-- Actually there are many ways for measuring this differences. One
method could be mean sqaure, the other could be the the usual
difference.

> Bear in mind that a measure of the difference should probably be a real, non-negative scalar, which needs to be computed as a function of the image arrays.

-- Yes the measure of the difference should be real and non-negative.

> You might want to try several possibilities to see what works best, but the first thing is to think of at least one plausible measure.

Thanks for repying for now. Look forward for your further mails.
From: David Young on
sW <sajjad302(a)gmail.com> wrote in message <ae0be899-1973-4154-b4db-3bc8de8af8b2(a)k29g2000yqh.googlegroups.com>...
> ...
> > I think that step is up to you - if you can say what you mean by the difference, it might be possible to help with the programming.
>
> -- Actually there are many ways for measuring this differences. One
> method could be mean sqaure, the other could be the the usual
> difference.

I'm not sure what the usual difference is, but the mean squared difference of two images can be computed like this:

difference = im1 - im2;
squared_difference = difference .^ 2;
msd = mean(squared_difference(:));
From: Tu on
Please help me in reading STRUCT into MOVIE.

Then I need to change the movie into MPEG format.

Thanks.