How can I display videos without movie()?

3 ビュー (過去 30 日間)
Enes Alkan
Enes Alkan 2020 年 4 月 2 日
コメント済み: Image Analyst 2020 年 5 月 3 日
Hello, first of all I am sorry for my English.
I am making a project on GUI. It is video denoising. First video is original video, second one is noised video, third one is denoised video. When I use this code, filtered videos get longer. It is like a slow motion video. Let's say that original video is 7 seconds. Noisy video is more than that. And also filtered video is longer than original video.
I can solve it using movie(). But I want to compare videos. I want to see all of them in the screen. I don't want to use figure to create a new window.
But movie() always waits for the playing to finish.
Here is my gui.fig
% Here is my original video
v=VideoReader(filename);
H=v.Height;
W=v.Width;
s1=struct('cdata', zeros(H,W,3, 'uint8'), 'colormap', []);
k=1;
axes1=handles.axes1;
while hasFrame(v)
s1(k).cdata=readFrame(v);
image(s1(k).cdata,'Parent',axes1);
pause(1/v.FrameRate);
k=k+1;
end
% Here is my noisy video
value= get(hObject,'Value');
s2=struct('cdata', zeros(H,W,3, 'uint8'), 'colormap', []);
axes2=handles.axes2;
if value==2
for i=1:k-1
s2(i).cdata=tuzbiberGurultusu(s1(i).cdata);
image(s2(i).cdata,'Parent',axes2);
pause(1/v.FrameRate);
end
end
% Here is my filtered video
value= get(hObject,'Value');
s3=struct('cdata', zeros(H,W,3, 'uint8'), 'colormap', []);
axes3=handles.axes3;
if value==2
for i=1:k-1
h=fspecial('average',3);
s3(i).cdata=imfilter(s2(i).cdata,h);
image(s3(i).cdata,'Parent',axes3);
pause(1/v.FrameRate);
end
end

回答 (2 件)

Harshendra Shah
Harshendra Shah 2020 年 4 月 9 日

Image Analyst
Image Analyst 2020 年 5 月 3 日
If you want to have the OS play the movie, try calling winopen(filename) (Windows only), or system().
  2 件のコメント
Enes Alkan
Enes Alkan 2020 年 5 月 3 日
So I should write video to file and then I should call winopen() ?
Image Analyst
Image Analyst 2020 年 5 月 3 日
You can do that if you want. Another way wuld be to make a new movie where you stitch together the frames from the two movies side by side. That way they'll always by in sync.

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

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by