How can I display videos without movie()?
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
Harshendra Shah
2020-4-9
Hi Enes,
Here are few MATLAB Answers links which might help you:
I hope this helps.
0 个评论
Image Analyst
2020-5-3
If you want to have the OS play the movie, try calling winopen(filename) (Windows only), or system().
2 个评论
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!