octave: Displaying Images
32.2 Displaying Images
======================
A natural part of image processing is visualization of an image. The
most basic function for this is the ‘imshow’ function that shows the
image given in the first input argument.
-- : imshow (IM)
-- : imshow (IM, LIMITS)
-- : imshow (IM, MAP)
-- : imshow (RGB, ...)
-- : imshow (FILENAME)
-- : imshow (..., STRING_PARAM1, VALUE1, ...)
-- : H = imshow (...)
Display the image IM, where IM can be a 2-dimensional (grayscale
image) or a 3-dimensional (RGB image) matrix.
If LIMITS is a 2-element vector ‘[LOW, HIGH]’, the image is shown
using a display range between LOW and HIGH. If an empty matrix is
passed for LIMITS, the display range is computed as the range
between the minimal and the maximal value in the image.
If MAP is a valid color map, the image will be shown as an indexed
image using the supplied color map.
If a filename is given instead of an image, the file will be read
and shown.
If given, the parameter STRING_PARAM1 has value VALUE1.
STRING_PARAM1 can be any of the following:
"displayrange"
VALUE1 is the display range as described above.
"colormap"
VALUE1 is the colormap to use when displaying an indexed
image.
"xdata"
If VALUE1 is a two element vector, it must contain horizontal
axis limits in the form [xmin xmax]; Otherwise VALUE1 must be
a vector and only the first and last elements will be used for
xmin and xmax respectively.
"ydata"
If VALUE1 is a two element vector, it must contain vertical
axis limits in the form [ymin ymax]; Otherwise VALUE1 must be
a vector and only the first and last elements will be used for
ymin and ymax respectively.
The optional return value H is a graphics handle to the image.
DONTPRINTYET See also: image XREFimage, imagesc XREFimagesc, *noteDONTPRINTYET DONTPRINTYET See also: image XREFimage, imagesc XREFimagesc,
colormap XREFcolormap, gray2ind XREFgray2ind, *noteDONTPRINTYET DONTPRINTYET See also: image XREFimage, imagesc XREFimagesc,
colormap XREFcolormap, gray2ind XREFgray2ind,
rgb2ind XREFrgb2ind.
-- : image (IMG)
-- : image (X, Y, IMG)
-- : image (..., "PROP", VAL, ...)
-- : image ("PROP1", VAL1, ...)
-- : H = image (...)
Display a matrix as an indexed color image.
The elements of IMG are indices into the current colormap.
X and Y are optional 2-element vectors, ‘[min, max]’, which specify
the range for the axis labels. If a range is specified as
‘[max, min]’ then the image will be reversed along that axis. For
convenience, X and Y may be specified as N-element vectors matching
the length of the data in IMG. However, only the first and last
elements will be used to determine the axis limits.
Multiple property/value pairs may be specified for the image
object, but they must appear in pairs.
The optional return value H is a graphics handle to the image.
Implementation Note: The origin (0, 0) for images is located in the
upper left. For ordinary plots, the origin is located in the lower
left. Octave handles this inversion by plotting the data normally,
and then reversing the direction of the y-axis by setting the
‘ydir’ property to "reverse". This has implications whenever an
image and an ordinary plot need to be overlaid. The recommended
solution is to display the image and then plot the reversed ydata
using, for example, ‘flipud (ydata)’.
Calling Forms: The ‘image’ function can be called in two forms:
High-Level and Low-Level. When invoked with normal options, the
High-Level form is used which first calls ‘newplot’ to prepare the
graphic figure and axes. When the only inputs to ‘image’ are
property/value pairs the Low-Level form is used which creates a new
instance of an image object and inserts it in the current axes.
See also: imshow XREFimshow, imagesc XREFimagesc,
colormap XREFcolormap.
-- : imagesc (IMG)
-- : imagesc (X, Y, IMG)
-- : imagesc (..., CLIMITS)
-- : imagesc (..., "PROP", VAL, ...)
-- : imagesc ("PROP1", VAL1, ...)
-- : imagesc (HAX, ...)
-- : H = imagesc (...)
Display a scaled version of the matrix IMG as a color image.
The colormap is scaled so that the entries of the matrix occupy the
entire colormap. If ‘CLIMITS = [LO, HI]’ is given, then that range
is set to the "clim" of the current axes.
The axis values corresponding to the matrix elements are specified
in X and Y, either as pairs giving the minimum and maximum values
for the respective axes, or as values for each row and column of
the matrix IMG.
The optional return value H is a graphics handle to the image.
Calling Forms: The ‘imagesc’ function can be called in two forms:
High-Level and Low-Level. When invoked with normal options, the
High-Level form is used which first calls ‘newplot’ to prepare the
graphic figure and axes. When the only inputs to ‘image’ are
property/value pairs the Low-Level form is used which creates a new
instance of an image object and inserts it in the current axes.
DONTPRINTYET See also: image XREFimage, imshow XREFimshow, *noteDONTPRINTYET See also: image XREFimage, imshow XREFimshow,
caxis XREFcaxis.