Image Class Function Manual (D-F)

DIST

| HOME | BACK |

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)
->Img(0,0) = 1
->print Img.matrix()


 no of row    : 3
 no of column : 3

 0:    1.00000    0.00000    0.00000
 1:    0.00000    0.00000    0.00000
 2:    0.00000    0.00000    0.00000


->Img_new = Img.dist()

Now calculating shortest distance from object...

Percent done : 0
             : 30
             : 100


->print Img_new.matrix()

 no of row    : 3
 no of column : 3

 0:    0.00000    1.00000    2.00000
 1:    1.00000    1.41421    2.23607
 2:    2.00000    2.23607    2.82843

 

See also (class function)

 

| HOME | BACK |


DOUBLE

| HOME | BACK |

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

| HOME | BACK |


DRWBREAKLINE

| HOME | BACK |

Purpose

To draw a break-line on an Image.  A break-line has elevations along all points in the line and is defined by 2 points.  The user inputs a break line by specifying 2 end points and their elevations, then this function determines elevations of all other points on the line and assignes them to those points of the line. 

Class

Image, Image_flt

Usage

{void} object.DRWBREAKLINE({double} argm1, {double} argm2, {double} argm3, {double} argm4, {double} argm5, {double} argm6)

argm1 = x coordinate of the first point

argm2 = y coordinate of the first point

argm3 = z coordinate, elevation, of the first point

argm4 = x coordinate of the second point

argm5 = y coordinate of the second point

argm6 = z coordinate, elevation, of the first point

 

Example:

->A.drwbreakline(10.5, 10.8, 3.6, 2.0, 100.8, 9.5)       

->

See also (class function)

drwbreakpline, drwvecbreakpline

| HOME | BACK |


DRWBREAKPLINE

| HOME | BACK |

Purpose

To draw a serie of break lines, a break-polyline, on an Image.  A break line has elevations along all points in the line and is defined by 2 points.  A break-polyline is defined by a serie of break-lines, called a brek-polyl;ine. The user inputs a break-polyline by specifying end points and their elevations starting from the first point, followed by the second point, the third point, and so on until the last point. 

Class

Image, Image_flt

Usage

{void} object.DRWBREAKPLINE({VecPt3D} argm1)

argm1 = Vector of 3D points

Example:

->v = VecPt3d(10)
->v.pushback(Pt3d(0, 1.5, 7.8))
->v.pushback(Pt3d(22.3, 35.4, 19.9))
->v.pushback(Pt3d(79, 52.3, 12.9))
->a.drwbreakpline(v)
->

See also (class function)

drwbreakline, drwvecbreakpline

| HOME | BACK |


DRWVECBREAKPLINE

| HOME | BACK |

Purpose

To draw a serie of break-poly lines, a vector of break-polylines, on an Image.  The users specifies a vector of  break-poly lines by using the Vec3DPline object.

Class

Image, Image_flt

Usage

{void} object.DRWVECBREAKPLINE({Vec3DPline} argm1)

argm1 = Vector of 3D points

Example:

->V_brkpline = Vec3dpline(10)
->v1 = VecPt3d(10)
->v1.pushback(Pt3d(0, 1.5, 7.8))
->v1.pushback(Pt3d(22.3, 35.4, 19.9))
->v1.pushback(Pt3d(79, 52.3, 12.9))
->v2 = VecPt3d(10)
->v2.pushback(Pt3d(0, 1.5, 7.8))
->v2.pushback(Pt3d(22.3, 35.4, 19.9))
->v2.pushback(Pt3d(79, 52.3, 12.9))
->V_brkpline.pushback(v1)
->V_brkpline.pushback(v2)
->a.drwvecbreakpline(V_brkpline)

See also (class function)

drwbreakline, drwbreakpline

| HOME | BACK |


DRWCIRCLE

| HOME | BACK |

Purpose

To draw a circle on 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

| HOME | BACK |


DRWELLIPSE

| HOME | BACK |

Purpose

To draw an ellipse on 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

| HOME | BACK |


DRWLINE

| HOME | BACK |

Purpose

To draw a line on 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

| HOME | BACK |


DRWPLINE

| HOME | BACK |

Purpose

To draw a poly-line on 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

| HOME | BACK |


DRWPOINT

| HOME | BACK |

Purpose

To draw a point on 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

| HOME | BACK |


DRWRECTANG

| HOME | BACK |

Purpose

To draw a rectangle on 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

| HOME | BACK |


DRWSQUARE

| HOME | BACK |

Purpose

To draw a square on 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

| HOME | BACK |


DRWVECCIRCLE

| HOME | BACK |

Purpose

To draw a list of circles on 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

| HOME | BACK |


DRWVECPLINE

| HOME | BACK |

Purpose

To draw a list of poly-lines on 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

| HOME | BACK |


DRWTEXT

| HOME | BACK |

Purpose

To draw a text on an Image.  Characyers unknown to Noobeed will be drawn as "?".

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)       

->

 

| HOME | BACK |


EDGESOBEL

| HOME | BACK |

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

| HOME | BACK |


FEATHER

| HOME | BACK |

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

| HOME | BACK |


FILLPLANE

| HOME | BACK |

Purpose

To fill elevations to a plane on an Image.  The plane boundary is defined by using a set of 3D polylines, or 3D points, which is in turn defined by a VecPt3D object. All points lie inside the plane will have elevation values accoprding to the plane equation, z = Ax + By + C, which is determined inside the function.

This function is very similar to the "fillpoly" function, except that the values used to fill in the polygon are elevations in stead of pen color.  This function calls to function "fillpoly", then calculates the plane parameters using least squares fitting, then alter the filled pixels' values with elevations according to the plane parameters.

Class

Image, Image_flt

Usage

{void} object.FILLPLANE({VecPt3D} argm1)

argm1 = list of x y z coordinates of a plane polygon, stored in a VecPt3D object.

Example:

->A.fillplane(pline1)       

->

See also (class function)

fillpoly

| HOME | BACK |


FILLPOLY

| HOME | BACK |

Purpose

To fill a closed polygon, defined by a poly-line, on an Image.  The fill value is taken from the current value of the red color, set by command "set pencolor".

Seer details of this function in "fillpoly" of class Matrix.

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

| HOME | BACK |


FLAG_NULL

| HOME | BACK |

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

| HOME | BACK |


FLOAT

| HOME | BACK |

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

| HOME | BACK |


FLOOD

| HOME | BACK |

Purpose

To detect a uniform region on 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()

ans =

 no of row    : 3
 no of column : 3

 0:    0    0    0
 1:    0    1    0
 2:    0    0    0

See also (class function)

fillpoly

| HOME | BACK |