matlab getframe frame2im 存储坐标到图片


getframe


Capture movie frame
Syntax


getframe
F = getframe
F = getframe(h)
F = getframe(h,rect)

Description


getframe returns a movie frame. The frame is a snapshot (pixmap) of the current axes or figure.

F = getframe gets a frame from the current axes.

F = getframe(h) gets a frame from the figure or axes identified by handle h.

F = getframe(h,rect) specifies a rectangular area from which to copy the pixmap. rect is relative to the lower left corner of the figure or axes h, in pixel units. rect is a four-element vector in the form [left bottom width height], where width and height define the dimensions of the rectangle.


frame2im - Return image data associated with movie frame

Syntax

[X,Map] = frame2im(F)

Description

[X,Map] = frame2im(F) returnsthe indexed imageX and associated colormap Map fromthe single movie frame F. If the frame containstrue-color data, them-by-n-3matrix Map is empty. The functions getframe andim2frame createa 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

你可能感兴趣的:(Matlab)