Filter löschen
Filter löschen

need source code for display frames of the results from video pieces in one axes only.. how can be looping ?

1 Ansicht (letzte 30 Tage)
need source code for display frames of the results from video pieces in one axes only.. how can be looping??

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 3 Aug. 2011
If you use image() or imagesc() to display the images, then you can pass them the X and Y coordinates of the center of the lower left and upper right pixels. To display another image in the same axes, you would specify a different (X,Y) coordinate pair for the second image.

Weitere Antworten (1)

Image Analyst
Image Analyst am 3 Aug. 2011
Here's a snippet of source code if you need it:
mov = aviread(movieFullFileName);
% Determine how many frames there are.
numberOfFrames = size(mov, 2);
for frame = 1 : numberOfFrames
% Extract the frame from the movie structure.
thisFrame = mov(frame).cdata;
% Display it
axes(handleToYourAxisControl);
image(thisFrame);
caption = sprintf('Frame %4d of %d.', frame, numberOfFrames);
title(caption, 'FontSize', 15);
drawnow; % Force it to refresh the window.
end
  4 Kommentare
Megah Putri
Megah Putri am 3 Aug. 2011
hhhmmmm..... walter roberson, after running , msgbox under catch display "Codec AVI tidak didukung atau Corupted file AVI','Error','error'" ..... whyy?
Walter Roberson
Walter Roberson am 3 Aug. 2011
Is the AVI coded at a variable bit rate? If so then you need to read it through once before you know the correct NumberOfFrames .
I suggest that you change the 'error' of your final msgbox() argument:
s = lasterror();
msgbox('Codec AVI tidak didukung atau Corupted file AVI','Error',s.message);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by