How can I display videos without movie()?

3 visualizaciones (últimos 30 días)
Enes Alkan
Enes Alkan el 2 de Abr. de 2020
Comentada: Image Analyst el 3 de Mayo de 2020
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

Respuestas (2)

Harshendra Shah
Harshendra Shah el 9 de Abr. de 2020

Image Analyst
Image Analyst el 3 de Mayo de 2020
If you want to have the OS play the movie, try calling winopen(filename) (Windows only), or system().
  2 comentarios
Enes Alkan
Enes Alkan el 3 de Mayo de 2020
So I should write video to file and then I should call winopen() ?
Image Analyst
Image Analyst el 3 de Mayo de 2020
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.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by