storing the individual frames of a video i(existing on workspace) n to image locations and analyse each frame's image on imtool (perhaps using imwrite?).
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a video on the workspace, which I can open using movieplayer.
Now all I want to do is get each frame of the video and analyze it on imtool.
I tried:
number= size(fractogene)_ (fractogene is the name of my video)_
for frame = 1: number
thisFrame = mov(frame).cdata;
Image = subplot(1,2,1);
image(thisFrame);
axis square;
caption = sprintf('Frame %4d of %d.', frame, numberOfFrames);
title(caption, 'FontSize', fontSize);
drawnow;
end
It did open the imtool, but it was just a blue square....what went wrong?
but its too hard for me...PLEASE GIVE ME SOMETHING SIMPLE!
댓글 수: 0
답변 (2개)
Image Analyst
2011년 10월 16일
Your first frame is all zeros. Take a look at it with the Variable Editor. Or try typing out a few pixels in the command window like
>> thisFrame(20,30,1)
댓글 수: 2
Image Analyst
2011년 10월 16일
No that would not work. You're writing out the loop index "frame", which is just a single number, as an image. And your "thisframe" is all zeros for some reason - I have no idea why - maybe your movie is all black.
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!