Name

ShowImage — displays an image in a figure window

Calling Sequence

FigureHandle = ShowImage(Image, Title);

FigureHandle = ShowImage(Image, Title, ColorMap);

Parameters

Image

2D matrix of type uint8, uint16, uint32, double or boolean

Title

a string, can be empty

ColorMap

matrix with three columns

FigureHandle

handle to the window Image is displayed in

Description

ShowImage displays an image in the current figure window. If no figure window exists, a new one is created. A color image must be converted to an indexed image using the function RGB2Ind. A gray level image can be shown with the original gray values or pseudo colors. If an image of type boolean is displayed, pixels with the value %t are shown in white, pixels with the value %f are shown in black.

You can display only one image in a window using this function. Displaying two or more images in the same window might yield unsatisfactory results.

Examples

RGB = ReadImage('contrib\IPD-5.0\demos\teaset.png');

Image = RGB2Gray(RGB);

figure(); ShowImage(Image, 'Gray Level Image');

See also

Ind2RGB, RGB2Ind, ShowColorImage, DrawBoundingBoxes