Skip to Main Content Skip to Search
Product Documentation

frame2im - Return image data associated with movie frame

Syntax

[X,Map] = frame2im(F)

Description

[X,Map] = frame2im(F) returns the indexed image X and associated colormap Map from the single movie frame F. If the frame contains true-color data, the m-by-n-3 matrix Map is empty. The functions getframe and im2frame create a movie frame.

Examples

Create and capture an image using getframe and frame2im:

peaks                      %Make figure
f = getframe;              %Capture screen shot
[im,map] = frame2im(f);    %Return associated image data 
if isempty(map)            %Truecolor system
  rgb = im;
else                       %Indexed system
  rgb = ind2rgb(im,map);   %Convert image data
end

See Also

getframe | im2frame | movie

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS