clip intensity to specified levels - Maple Help

Home : Support : Online Help : Graphics : Image Processing : ImageTools Package : ImageTools/Clip

ImageTools[Clip] - clip intensity to specified levels

 Calling Sequence Clip( img, opts )

Parameters

 img - Image; the image to adjust opts - (optional) equation(s) of the form option = value; specify options for the Clip command

Description

 • The Clip command clips any pixel intensity value less than a lower bound to that bound, and greater than an upper bound to that bound.
 • The img parameter specifies the image to clip, and must be of type Image.
 • The options low and high specify the lower and upper bounds, respectively, to which intensities are clipped. If both  low and high are unspecified, then they are assigned the values 0.0 and 1.0, respectively. That is, by default, intensities are clipped to be between 0 and 1, inclusive.
 • If both low and high are specified, and the value of low exceeds that of high, an error is generated.
 • If only one bound is specified, the other one is unbounded. For example, Clip(img, high = 0.5) clips all intensities in img to be less than or equal to 0.5.
 • The Clip command is often useful after performing other image processing operations that may have produced out-of-bound values, and before performing operations that are not defined on out-of-bound values.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{data}:=\mathrm{Create}\left(\left[\left[-0.2,0.0,1.0,1.2\right]\right]\right)$
 ${\mathrm{data}}{:=}\left[\begin{array}{cccc}{-}{0.200000000000000}& {0.}& {1.}& {1.20000000000000}\end{array}\right]$ (1)
 > $\mathrm{Clip}\left(\mathrm{data},\mathrm{low}=0.1,\mathrm{high}=0.9\right)$
 $\left[\begin{array}{cccc}{0.100000000000000}& {0.100000000000000}& {0.900000000000000}& {0.900000000000000}\end{array}\right]$ (2)