GetSubImage - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

ImageTools

 GetSubImage
 extract a subimage from an image

 Calling Sequence GetSubImage( img, row, col, ht, wd, opts )

Parameters

 img - Image row - integer; initial row of the subimage col - integer; initial column of the subimage ht - posint; height of the subimage wd - posint; width of the subimage opts - (optional) equation(s) of the form option = value; specify options for the GetSubImage command

Options

 • output = Image
 Specifies a data structure into which the output is written. This can be used to avoid allocating memory. The size, number of layers, and order must match that of the subimage. The default is NULL.
 • reindex = truefalse
 If true, the indices of the returned image are reindexed so that they start at 1. If false, the row and column indices start at row and col, respectively. The default is false.

Description

 • The GetSubImage command returns a subimage of a given image.
 • The img parameter is the image.
 • The row and col parameters specify the coordinates of the upper left pixel of the desired subimage of img.
 • The ht and wd parameters specify the height and width of the subimage.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{img}≔\mathrm{Create}\left(500,500,\left(r,c\right)↦\frac{r}{1000}+\frac{c}{1000}\right):$
 > $\mathrm{imgs}≔\mathrm{GetSubImage}\left(\mathrm{img},100,100,200,200\right):$
 > $\mathrm{Embed}\left(\left[\mathrm{img},\mathrm{imgs}\right]\right)$