How can I calculate the mean of a particular number of video frames?

I am doing a project on video processing.For that,at first I have completed shot detection.Now i want to select a single frame from every shot.Say,first 100 frames contains one shot.So i want to calculate the mean value of the pixels(row,column) of that 100 frames.Then I shall compare the mean value with all that 100 frames and select the frame which one have the closest value.Please help me with the code.

 採用された回答

Image Analyst
Image Analyst 2013 年 10 月 28 日

0 投票

Try the attached. I believe it does what you want.

2 件のコメント

Arnav
Arnav 2013 年 10 月 28 日
Many many thanks for your help Image Analyst.It is really very very helpful..It works perfectly.
Arnav
Arnav 2013 年 11 月 27 日
@Image Analyst,Sir I have doubt.When I am using starting frame before 100,I mean till 99th frame as a starting frame,the code has worked perfectly.But at that very moment when I am using frame no after 100 like 101,400 whatever.It is not showing the result.Will you help me please?

サインインしてコメントする。

その他の回答 (2 件)

Youssef  Khmou
Youssef Khmou 2013 年 10 月 28 日

0 投票

hi,
if it is grayscale Video then :
[m,n,p]=size(X);
MEAN=zeros(1,p);
for x=1:p
MEAN(x)=mean(X(:,:,x));
end
pavithra g
pavithra g 2016 年 9 月 21 日

0 投票

how to calculate the mean of 1 to 5 frames for grayscale image.

1 件のコメント

Image Analyst
Image Analyst 2016 年 9 月 21 日
theMean = sum(double(frame1(:))+double(frame2(:))+double(frame3(:))+double(frame4(:))+double(frame5(:)))/5

サインインしてコメントする。

質問済み:

2013 年 10 月 28 日

コメント済み:

2016 年 9 月 21 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by