Framing a Video

3 vues (au cours des 30 derniers jours)
Nilushi Dissanayake
Nilushi Dissanayake le 5 Fév 2011
I need help for writing codes for frame a Video in order to take 10 sequence by using Matlab codes. There is a avi file and i need to take 10 sequence out of it for my image processing. I required write a code on a M file to do this by using Matlab codings.
PLS need help ASAP
  1 commentaire
Andreas Goser
Andreas Goser le 5 Fév 2011
This looks like you have not started yet, right? MATLAB Answers is intended to help you with specific coding problems or for help to get started, but not for providing complete code. I interprete your question that you need some starting points and will craft and answer with that in mind

Connectez-vous pour commenter.

Réponses (4)

Andreas Goser
Andreas Goser le 5 Fév 2011
As a starting point, please familiarize with the commands AVIREAD, MMREADER, VIDEOREADER, e.g.:
The rest of the description remains unclear to me. It sounds like you would like to use only every 10th frame. You can certainly do that with the imported structure.

Pramod Bhat
Pramod Bhat le 12 Fév 2011
Dear sir, even I am working on video processing. I am able to capture video from the webcam.But still i am not able to convert the video to frames and process them. plz help.

Walter Roberson
Walter Roberson le 12 Fév 2011
aviread() accepts as a parameter the frame number(s) to read. The output of aviread() is an array of movie frames. The structure of movie frames is described in the getframe documentation. You can then loop over the frame array using frame2im() to convert the frames to images.
If your avi movie happens to be TrueColor (quite plausible) then if you stored the result of the aviread() in the variable F, you can do all the frame conversions at once, using
images = cat(4,F.cdata);
This will result in a 4D array indexed by row, column, plane, and (relative) frame. Plane in this sense is 1 for R, 2 for G, 3 for B.
You can test for TrueColor movies by using
if isempty(F(1).colormap)
%it _is_ truecolor
else
%not truecolor. Have to convert the frames one by one
end

James Bond
James Bond le 12 Fév 2011
^^^ Walter, I tried using aviread but received the following error:
F=aviread('hello.avi')
Warning: AVIREAD will be removed in a future release. Use MMREADER instead.
> In aviread at 29 ??? Error using ==> findchunk at 20 Incorrect chunk size information in AVI file.
Error in ==> aviinfo at 96 [chunk, msg, msgID] = findchunk(fid,'RIFF');
Error in ==> aviread>getAviInfo at 439 info = aviinfo(filename,'Robust');
Error in ==> aviread at 57 info = getAviInfo( filename );
I don't understand why I get these errors.
  1 commentaire
Walter Roberson
Walter Roberson le 12 Fév 2011
You could try using mmreader, but I suspect it might not work any better. I think you might have a corrupt video. It might help to read it in to some other program and re-save it.

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by