Why does the GETFRAME function in MATLAB produce movie frames of poor resolution?

44 views (last 30 days)
If I display my image in a small axes and use the GETFRAME function to convert the image to a movie frame, the resulting movie frame has poor resolution.
For instance, using the code:
load trees
set (gca,'units','pixels','position',[100 100 100 100])
imagesc (X)
a = getframe(gca)
close all
imagesc (a.cdata)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This change has been incorporated into the documentation in Release 14 Service Pack 3 (R14SP3). For previous releases, read below for any additional information:
The resolution of framed images depends on the size of the axes in pixels when the GETFRAME function is called. Since GETFRAME takes a snapshot of the screen, if the axes is small in size and/or you have restricted the view to a window within the axes, GETFRAME will capture fewer screen pixels. This will impact the resolution when the frame is enlarged for display.
To increase the framed image resolution, you can expand the axes or convert the image to a frame using the IM2FRAME function.
For example:
load trees
b= im2frame(X,map)
imagesc (b.cdata)

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!