ImageTools - Maple Programming Help

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

ImageTools

 Complement
 compute the complement of an image

 Calling Sequence Complement( img, peak, opts )

Parameters

 img - Image; the image peak - (optional) realcons; maximum pixel value opts - (optional) equation(s) of the form option = value; specify options for the Complement command

Options

 • inplace = truefalse
 Specifies whether the operation is performed in-place. This can be used to avoid allocating memory. The default is false.
 • output = Image
 Specifies a data structure into which the output is written. This can be used to avoid allocating memory. The size and number of layers must match that of the input. The dimensions of the output image are adjusted so that the row and column indices match the input. The default is NULL.

Description

 • The Complement command computes the complement of img. The operation applies the transform $\mathrm{peak}-\mathrm{pixel}$ to each pixel in the image. It does not affect the alpha channel (fourth layer).
 • The img parameter is the input image.
 • The optional parameter peak specifies the peak value to use. The default is 1.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{img1}≔\mathrm{Create}\left(100,200,\left(r,c\right)→\mathrm{evalf}\left(\left(0.5+0.5\mathrm{sin}\left(\left(0.005+0.003r\right)r\right)\right)\left(0.5+0.5\mathrm{sin}\left(0.15c\right)\right)\right)\right):$
 > $\mathrm{img2}≔\mathrm{Complement}\left(\mathrm{img1}\right):$
 > $\mathrm{img3}≔\mathrm{Complement}\left(\mathrm{img1},0.5\right):$
 > $\mathrm{plt1}≔\mathrm{PlotHistogram}\left(\mathrm{img1},\mathrm{normalized},\mathrm{color}=\mathrm{red}\right):$
 > $\mathrm{plt2}≔\mathrm{PlotHistogram}\left(\mathrm{img2},\mathrm{normalized},\mathrm{color}=\mathrm{green}\right):$
 > $\mathrm{plt3}≔\mathrm{PlotHistogram}\left(\mathrm{img3},\mathrm{normalized},\mathrm{autorange},\mathrm{color}=\mathrm{blue}\right):$
 > $\mathrm{plots}[\mathrm{display}]\left(\mathrm{plt1},\mathrm{plt2},\mathrm{plt3}\right)$
 > $\mathrm{Embed}\left(\left[\mathrm{img1},\mathrm{img2},\mathrm{img3}\right]\right)$

 >