Image Processing Toolbox    
getimage

Get image data from axes

Syntax

Description

A = getimage(h) returns the first image data contained in the Handle Graphics object h. h can be a figure, axes, image, or texture-mapped surface. A is identical to the image CData; it contains the same values and is of the same class (uint8 or double) as the image CData. If h is not an image or does not contain an image or texture-mapped surface, A is empty.

[x,y,A] = getimage(h) returns the image XData in x and the YData in y. XData and YData are two-element vectors that indicate the range of the x-axis and y-axis.

[...,A,flag] = getimage(h) returns an integer flag that indicates the type of image h contains. This table summarizes the possible values for flag.

Flag
Type of Image
0
Not an image; A is returned as an empty matrix
1
Intensity image with values in standard range ([0,1] for double arrays, [0,255] for uint8 arrays, [0,65535] for uint16 arrays)
2
Indexed image
3
Intensity data, but not in standard range
4
RGB image

[...] = getimage returns information for the current axes. It is equivalent to [...] = getimage(gca).

Class Support

The output array A is of the same class as the image CData. All other inputs and outputs are of class double.

Example

This example illustrates obtaining the image data from an image displayed directly from a file.


  getheight getneighbors