using getframe to separate frames from a video...need easy code.

Fractogene is the name of my video....
I tried:
for frame = 1:number
fractogene(frame)= getframe;
end
fractogene(117)
ans =
cdata: [240x320 uint16]
colormap: [0x3 double]
As you can see, I got a value...Does this mean anything at all?
How can I plot it, as I didn't get a plot...

 採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 16 日

0 投票

image(fractogene(117).cdata)

4 件のコメント

Yagnaseni Roy
Yagnaseni Roy 2011 年 10 月 16 日
You're a life-saver!!!!!!!!!!
Walter Roberson
Walter Roberson 2011 年 10 月 16 日
Note that each of the getframe() is going to be making a copy of your current figure, and you have nothing in your code which updates your current figure so every frame would be the same.
You do not use getframe() to read from an existing video file. See the VideoReader class or mmreader()
Yagnaseni Roy
Yagnaseni Roy 2011 年 10 月 17 日
I would rather like to view my images as a montage and attach a histogram to each of them to....I am able to make an image into a histogram using imhist function, but the image itself goes away....i want BOTH the image and the histogram to be viewable at the same time and all the frames should be arranged in a montage..
Walter Roberson
Walter Roberson 2011 年 10 月 17 日
Use subplot() to arrange the images. Note though that if you have a lot of images, the plots are going to come out very small, so you may wish to look in the MATLAB File Exchange to find one of the various contributions that offers a scrollable image area.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2011 年 10 月 16 日

0 投票

No that doesn't mean anything. You're getting the data in an axes but you haven't loaded anything into the axes, at least not in the code you've shown.

Community Treasure Hunt

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

Start Hunting!

Translated by