Framing a Video
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Andreas Goser
2011년 2월 5일
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
답변 (4개)
Andreas Goser
2011년 2월 5일
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.
댓글 수: 0
Pramod Bhat
2011년 2월 12일
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.
댓글 수: 0
Walter Roberson
2011년 2월 12일
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
댓글 수: 0
James Bond
2011년 2월 12일
^^^ 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
Walter Roberson
2011년 2월 12일
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.
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!