The ImageProcessing function ImageRead
should be used to load image data stored in one of the supported image formats. ImageRead
makes use of the built-in Import
function for the low-level format conversion operations and converts the output Graphics
to an ImageData
expression (using utility function GraphicsToImageData
). The type argument string may be omitted if a standard filename suffix is used.
As demonstrated in Section 2.4
expressions may be conveniently displayed using the standard Mathematica Graphics
objects behaves like any other Mathematica Graphics
, see Raster
). A meshed ImageData
expression will, by default, display as a single composite color image.
On occasion, the default contrast may not provide optimum viewing conditions. The option PlotRange may be used to adjust image contrast. As in 2D and 3D plots, PlotRange
allows the user to adjust the dynamic range of the display. Here we show two examples, one a narrowing of the display range, thus causing saturation, and the other an expansion of the range, thus making the image appear darker.
In Section 2.2
, we showed how to obtain and plot a row or column profile of a raw image data array. Here we return to this problem to show how to obtain row or column profiles of ImageData
expressions. Later, in Section 5.5
, we will show how data profiles along any arbitrary path may be extracted. As in the earlier example, functions Part
may be used to get a row or column of the image data.
The user may sometimes need to combine image graphics with Mathematica Graphics
primitives, either for annotation purposes or for region-of-interest processing purposes. This is complicated just a little by the fact that graphics coordinates and matrix indices are reversed with respect to each other. It should be noted that while 2D arrays use a row-major notation, (i.e., row coordinate followed by column coordinate) graphics use the familiar x
position notation, with x
as the horizontal axis and y
as the vertical axis.
Here we demonstrate the use of GraphicsRotate
. Suppose we wished to annotate the beans
image with a blue-colored disk at position r=26 and c=105, where r and c
stand for the row and column, respectively.