$ImageProcessingInstallationDirectory | gives the top-level installation directory | $ImageProcessingDataDirectory | gives |
ImageProcessing file system symbols. Out[2]= | |
Out[3]= | |
| format of single-channel (i.e., monochrome) image |
ImageData[{{{r0,0,g0,0,b0,0}, {r0,1,g0,1,b0,1}...}}, PixelInterleave→True, ColorFunction→cf] |
| format of multichannel ( image in planar configuration |
ImageData expressions. Out[4]//InputForm= | |
RawImageData[img] | returns raw data from an ImageData expression | MeshedImageData[img] | returns an ImageData expression with a meshed data structure | PlanarImageData[img] | returns an ImageData expression with a planar data structure | FromChannels[img] | returns a meshed ImageData expression from multiple single-color ImageData expressions | ToChannels[img] | returns a list of single-color ImageData expressions |
Structure conversion functions. Out[5]//InputForm= | |
Here we split the rgb image into three single-color GrayLevel channels. Each channel is defined by an ImageData expression. Out[6]//InputForm= | |
This returns an RGBColor meshed image from the three individual channels. Out[7]//InputForm= | |
ImageDepth[img] | returns the number of color channels in img | ImageOptions[img] | returns the list of options in img | ImageDimensions[img] | returns the planar dimensions of img | RawImageData[img] | returns the raw image data in img | ImageDataQ[img] | returns True if img is an ImageData expression and False otherwise |
ImageData structure interrogation functions. Out[8]//MatrixForm= | |
Out[9]= | |
Out[10]= | |
Out[11]= | |
Having described the structure of ImageData, we now turn our attention to the problem of using the expression as an argument to other ImageProcessing and Mathematica functions. The goal of making ImageData objects easy to use requires that built-in Mathematica functions, to the degree that this makes sense, accept these expressions as valid arguments. Consider first the group of arithmetic operators. Here are a couple of examples. The basic arithmetic and logic operations (Plus, Times, Subract, Divide, Power, BitAnd, BitOr, BitXor) between a scalar and an ImageData expression or two ImageData expressions work as expected. Out[12]//InputForm= | |
Out[13]//InputForm= | |
Out[14]//InputForm= | |
ImagePlus[img, a] | Plus operator | ImageTimes[img, a] | Times | ImagePower[img, a] | Power operator | ImageSubtract[img, a] | Subtract operator | ImageDivide[img, a] | Divide operator | ImageBitAnd[img, a] | BitAnd operator | ImageBitOr[img, a] | BitOr operator | ImageBitXor[img, a] | BitXor operator |
ImageProcessing arithmetic and logic operators. Out[15]//InputForm= | |
Out[16]//InputForm= | |
Out[17]= | |
In addition to the previously described extensions to arithmetic and logic commands, the package includes other functions that greatly enhance the ease-of-use of ImageData objects. The ImageTake function adapts the functionality of Take, while ImageThread allows the user to easily apply functions to individual channels of an image. The function ImageTakeGUI uses a graphical user interface to simplify the selection of one or more subregions of a given example image. ImageTake[img, {x1, x2}, {y1, y2}] | returns a subregion of img defined by the row coordinates {x1, x2} and column coordinates {y1, y2} | ImageTakeGUI[img] | returns one or more subregions of img using a user interface tool | ImageThread[f, img, args] | applies |
Extensions to Take and Thread. Out[18]//InputForm= | |
Out[19]//InputForm= | |
Out[20]//InputForm= | |
|