|
Image Class Function Manual (D-F) |
Purpose
To create a distance image, in which each pixel contains a value of the shortest distance to an object in the original image, the calling image. Any pixel in the original image that has a value greater than zero is considered an object.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{Image} ret = object.DIST()
Example:
|
->Img =
Image(3,3)
|
See also (class function)
Purpose
To convert to a Image object. This function would make more sense when the calling Image is of other types than double.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{Image} ret = object.DOUBLE()
Example:
|
->A_new = A.double() -> |
See also (class function)
float, int, short, uchar, bool
Purpose
To draw a circle in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWCIRCLE({double} argm1, {double} argm2, {double} argm3)
argm1 = x coordinate of the center of the circle being drawn
argm2 = y coordinate of the center of the circle being drawn
argm3 = radius of the circle (in x y coordinate system unit)
Example:
|
->A.drwcircle(10,10,3) -> |
See also (class function)
drwellipse, drwline, drwpline, drwrectang, drwsquare, drwvecpline
Purpose
To draw an ellipse in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWELLIPSE({double} argm1, {double} argm2, {double} argm3, {double} argm4)
argm1 = x coordinate of the center of the ellipse being drawn
argm2 = y coordinate of the center of the ellipse being drawn
argm3 = semi-major axis of the ellipse (in x y coordinate system unit)
argm4 = semi-minor axis of the ellipse (in x y coordinate system unit)
Example:
|
->A.drwellipse(10,10,3,2) -> |
See also (class function)
drwcircle, drwline, drwpline, drwrectang, drwsquare, drwvecpline
Purpose
To draw an line in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWLINE({double} argm1, {double} argm2, {double} argm3, {double} argm4)
argm1 = x coordinate of the first point
argm2 = y coordinate of the first point
argm3 = x coordinate of the second point
argm4 = y coordinate of the second point
Example:
|
->A.drwline(10,10,3,2) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwrectang, drwsquare, drwvecpline
Purpose
To draw a poly-line in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWPLINE({VecPt2D} argm1)
argm1 = list of x y coordinates of a poly-line, stored in a VecPt2D object
Example:
|
->A.drwpline(pline1) -> |
See also (class function)
drwcircle, drwellipse, drwline, drwrectang, drwsquare, drwvecpline
Purpose
To draw a point in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWPOINT({double} argm1, {double} argm2)
argm1 = x coordinate of the point
argm2 = y coordinate of the point
Example:
|
->A.drwpoint(10,100) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwrectang, drwsquare, drwvecpline
Purpose
To draw a rectangle in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWRECTANG({double} argm1, {double} argm2, {double} argm3, {double} argm4)
argm1 = x coordinate of the center point of the rectangle
argm2 = y coordinate of the center point of the rectangle
argm3 = width of the rectangle (in x y coordinate system unit)
argm4 = height of the rectangle (in x y coordinate system unit)
Example:
|
->A.drwrectang(10,10,3,2) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwline, drwsquare, drwvecpline
Purpose
To draw a square in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.DRWSQUARE({double} argm1, {double} argm2, {double} argm3)
argm1 = x coordinate of the center point of the square
argm2 = y coordinate of the center point of the square
argm3 = size of the square (in x y coordinate system unit)
Example:
|
->A.drwsquare(10,10,3) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwline, drwrectang, drwvecpline
Purpose
To draw a list of circles in an Image.
Class
Image_uch
Usage
{void} object.DRWSQUARE({VecPt2D} argm1, {int} argm2)
argm1 = list x y coordinates of centers of circles
argm2 = radius of the circles (in x y coordinate system unit)
Example:
|
->Img.drwveccircle(vec_center,3) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwrectang, drwsquare, drwvecpline
Purpose
To draw a list of poly-lines in an Image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.VECPLINE({VecXYpline} argm1)
argm1 = vector of poly-lines, stored in a VecXYpline object.
Example:
|
->A.drwvecpline(plines) -> |
See also (class function)
drwcircle, drwellipse, drwpline, drwline, drwrectang, drwsquare
Purpose
To draw a text in a matrix.
Class
Image_uch
Usage
{void} object.DRWTEXT({int} argm1,{int} argm2,{String} argm3,{int} argm4)
argm1 = x coordinate of upper left corner of the text block
argm2 = y coordinate of upper left corner of the text block
argm3 = a text string (at the moment only numbers are supported)
argm4 = height of the text (in image rectangular coordinate system unit, optimum is about 7-12 pixels when convert to matrix index unit)
Example:
|
->A.drwtext(10,20,"1256",10) -> |
Purpose
To make an edge image using the Sobel edge detector operator. The result edge image is a binary image, whose pixel values are either 0, background, or 255, edge pixel.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{Image_uch} ret = object.EDGESOBEL([{double} argm1])
argm1 = a cutoff value.
A pixel whose slope magnitude larger than cutoff value is considered edge pixel. If not given, the function will determine it by using a noise estimation function.
Example:
|
->B = A.edgesobel() -> |
See also (class function)
polyline
Purpose
To overlay one image on top of the other image such that the pixel in the overlap area will have a weighted average value of the two images. The assigned weight is a function of a distance from the pixel being evaluated to the nearest border line. This operation is used in mosaic making to create a seamless mosaic image.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
For class Image
{Image} ret = object.BICUBIC({Image} argm1, {double} argm2)
For class Image_flt
{Image_flt} ret = object.BICUBIC({Image_flt} argm1, {double} argm2)
For class Image_int
{Image_int} ret = object.BICUBIC({Image_int} argm1, {double} argm2)
For class Image_sht
{Image_sht} ret = object.BICUBIC({Image_sht} argm1, {double} argm2)
For class Image_uch
{Image_uch} ret = object.BICUBIC({Image_uch} argm1, {double} argm2)
For class Image_bln
{Image_bln} ret = object.BICUBIC({Image_bln} argm1, {double} argm2)
argm1 = The overlaying image
argm2 = resolution of the result image
Example:
|
->Img_new = Img_1.feather(Img_2, 30)
-> |
See also (class function)
mosiac, overlay, overlap
Purpose
To fill a closed polygon, defined by a poly-line, in an Image. The fill value is taken from the current value of the red color, set by command "set pencolor".
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{void} object.FILLPOLY({VecPt2D} argm1)
argm1 = list of x y coordinates of a polygon, stored in a VecPt2D object.
Example:
|
->A.fillpoly(pline1) -> |
See also (class function)
drwcircle, drwellipse, drwline, drwrectang, drwsquare, drwvecpline
Purpose
To report the current value of flag_null. Flag_null is a member data of a Matrix, which is a also a data member of Image. It indicates whether the null data in the matrix are taken into account in computation such as mean, min, max etc. When an Image is initiated, its flag_null value is zero (off).
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{bool} ret = object.FLAG_NULL()
Example:
|
->flag = A.flag_null()
-> |
See also (class function)
nulldata
Purpose
To convert to an Image_flt object.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{Image_flt} ret = object.FLOAT()
Example:
|
->A_new = A.float() -> |
See also (class function)
double, int, short, uchar, bool
Purpose
To detect a uniform region in an Image. A coordinate of a seed pixel is required in this function. Upon returning, all pixels that are contiguous to the seed pixel and have the same value as the seed pixel will have a value of 1, otherwise 0.
Class
Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln
Usage
{Image_uch} ret = object.FLOOD({double} argm1, {double} argm2)
argm1 = x coordinate of the seed pixel
argm2 = y coordinate of the seed pixel
Example:
|
->a = Image(3,3) ->A = [ 1 2 3; 4 5 6; 7 8 9] ->a.matrix() = A ->c = a.flood(1.5 ,1.5) ->print c.matrix() |
See also (class function)
fillpoly