Image Class Function Manual (A-C)

(  )

| HOME | BACK |

Purpose

To get a value of an element at a particular index. row and column number, in an Image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

 {double} ret  =  object({int} argm1, {int} argm2)

For class Image_flt

{float} ret  =  object({int} argm1, {int} argm2)

For class Image_int

{int} ret  =  object({int} argm1, {int} argm2)

For class Image_sht

{short} ret  =  object({int} argm1, {int} argm2)

For class Image_uch

{uchar} ret  =  object({int} argm1, {int} argm2)

For class Image_bln

{bool} ret  =  object({int} argm1, {int} argm2)

argm1 = row number

argm2 = column number

Example:

->Img = Image(3,3)

->A = [ 1 2 3; 4 5 6; 7 8 9]

->Img.matrix() = A

->print Img(0,1)

        2.00000

See also (class function)

set

| HOME | BACK |


ANAGLYPH

| HOME | BACK |

Purpose

To make an anaglyph image.  The calling Image is to be the left image and the Image in the argument is to be the right image.  Unlike the function "anaglyph" of the class matrix, where there is no spatial information in the object, function "anaglyph" of class "Image"  does not requires an amount of shift, it simple overlays one image on top of the other, according to their spatial information.  Hence, the two images must be in the same map projection.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image_rgb} ret  =  object.ANAGLYPH({Image_uch} argm1)

argm1 = the right image

Example:

->Img_color = A.anaglyph(B)

->

See also (class function)

makeleft, makeright

| HOME | BACK |


ASPECT

| HOME | BACK |

Purpose

To compute orientation of pixels in an Image.  It is expressed as an azimuth, an angle measured clockwise from the north, of the direction of the maximum slope.  It is necessary to first compute slope in x-direction and then slope in y-direction, then combine the two quantities to get the maximum slope.

There are a number of algorithms to calculate slope in x and slope in y directions.  This function offers 2 options, one is using 4 pixels (2 for calculating slope in x direction and 2 for calculating slope in y direction), the other is using 8 pixels to do the calculation.

The result aspect angles will have a unit of the current unit set by command "set angle".

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image} ret  =  object.ASPECT([{int} argm1])

argm1 = computation method (1 = using 4 pixels, 2 = using 8 pixels)

        (default value = 1)

Example:

->Asp = DEM.aspect()

See also (class function)

slope, slope_x, slope_y

| HOME | BACK |


BICUBIC

| HOME | BACK |

Purpose

To get a value at a particular x y coordinate, using bi-cubic interpolation.

This function creates a 3 pixel border region around the image, if the requested coordinate falls inside this region, the function will return a value using the nearest neighbor method.

If the coordinate is outside the region of the image, the function will return the current value of null data of the image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{double} ret  =  object.BICUBIC({double} argm1, {double} argm2)

For class Image_flt

{float} ret  =  object.BICUBIC({double} argm1, {double} argm2)

For class Image_int

{int} ret  =  object.BICUBIC({double} argm1, {double} argm2)

For class Image_sht

{short} ret  =  object.BICUBIC({double} argm1, {double} argm2)

For class Image_uch

{uchar} ret  =  object.BICUBIC({double} argm1, {double} argm2)

For class Image_bln

{bool} ret  =  object.BICUBIC({double} argm1, {double} argm2)

argm1 = x coordinate

argm2 = y coordinate

Example:

->val = Img.bicubic(12.544, 22.986)

->

See also (class function)

nearest, bilinear

| HOME | BACK |


BILINEAR

| HOME | BACK |

Purpose

To get a value at a particular x y coordinate, using bi-linear interpolation.

This function creates a 1 pixel border region around the image, if the requested coordinate falls inside this region, the function will return a value using the nearest neighbor method.

If the coordinate is outside the region of the image, the function will return the current value of null data of the image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{double} ret  =  object.BILINEAR({double} argm1, {double} argm2)

For class Image_flt

{float} ret  =  object.BILINEAR({double} argm1, {double} argm2)

For class Image_int

{int} ret  =  object.BILINEAR({double} argm1, {double} argm2)

For class Image_sht

{short} ret  =  object.BILINEAR({double} argm1, {double} argm2)

For class Image_uch

{uchar} ret  =  object.BILINEAR({double} argm1, {double} argm2)

For class Image_bln

{bool} ret  =  object.BILINEAR({double} argm1, {double} argm2)

argm1 = x coordinate

argm2 = y coordinate

Example:

->val = Img.bilinear(12.544, 22.986)

->

See also (class function)

nearest, bicubic

| HOME | BACK |


BINARY

| HOME | BACK |

Purpose

To make a binary Image, whose values are either 0 or 255.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Image_uch} ret  =  object.BINARY([{double} argm1])

For class Image_flt

{Image_uch} ret  =  object.BINARY([{float} argm1])

For class Image_int

{Image_uch} ret  =  object.BINARY([{int} argm1])

For class Image_sht

{Image_uch} ret  =  object.BINARY([{short} argm1])

For class Image_uch

{Image_uch} ret  =  object.BINARY([{uchar} argm1])

For class Image_bln

{Image_uch} ret  =  object.BINARY([{bool} argm1])

argm1 = The threshold value (if x > threshold; value = 255, otherwise value = 0)

        (default threshold value = 0)

Example:

->Img = Image(3,3)

->A = [ 1 2 3; 4 5 6; 7 8 9]

->Img.matrix() = A

->B = A.binary(4)

->print B.matrix()


 no of row    : 3
 no of column : 3

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

See also (class function)

reclass, reassign, set

| HOME | BACK |


BLANK

| HOME | BACK |

Purpose

To create a blank image.  Spatial information is also copied to the created blank image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Image} ret  =  object.BLANK([{double} argm1])

For class Image_flt

{Image_flt} ret  =  object.BLANK([{float} argm1])

For class Image_int

{Image_int} ret  =  object.BLANK([{int} argm1])

For class Image_sht

{Image_sht} ret  =  object.BLANK([{short} argm1])

For class Image_uch

{Image_uch} ret  =  object.BLANK([{uchar} argm1])

For class Image_bln

{Image_bln} ret  =  object.BLANK([{bool} argm1])

argm1 = initial value of the blank image

        (default threshold value = 0)

Example:

->Img_new = Img.blank()

->

See also (class function)

init

| HOME | BACK |


BOOL

| HOME | BACK |

Purpose

To convert to a boolean Image, an Image_bln object.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image_bln} ret  =  object.BOOL()

Example:

->B = A.bool()

->

See also (class function)

float, int, short, uchar

| HOME | BACK |


BWRGB

| HOME | BACK |

Purpose

To convert to an Image_rgb object, by assigning each R B B color component the same brightness value.

The resulting image will look exactly the same as a gray scale image.  This conversion is useful when the user wants to add color element to the object, e.g. draw lines, poly-lines in colors.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image_rgb} ret  =  object.BWRGB()

Example:

->B = A.bwrgb()

->

See also (class function)

float, int, short, uchar

| HOME | BACK |


CLOSE

| HOME | BACK |

Purpose

To close a virtually loaded Image.  This function is irrelevant to a normal Image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{void} object.CLOSE()

Example:

->A = Image()

->A.vload("Img_1")

->A.close()

See also (class function)

vload, load, save

| HOME | BACK |


COL2X

| HOME | BACK |

Purpose

To convert a column number to an x coordinate.  Please note that the arguments of the function are of type double, which allows a sub-pixel column number to be converted to an accurate x coordinate.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{double} ret  =  object.COL2X({double} argm1)

argm1 = column number

Example:

->A = Image(2,3)

->A.col2x(2)

ans =     2.50000

->A.col2x(0)

ans =     0.50000

See also (class function)

rc2xy, xy2rc, vecrc2xy, vecxy2rc, vidrc2xy, vidxy2rc, row2y

| HOME | BACK |


COMPMAX

| HOME | BACK |

Purpose

To compare elements of two Images, and store the maximum value in a new Image. 

The function first determines the spatial area where the two images are overlap, by using the function "overlap".  Hence the result image has the same resolution as the calling image.  Then the requested operation is done by getting two data from the two image at the same coordinate, using the current interpolation method set by command "set intp_mode".  Available interpolation modes are "nearest", "bilinear", and "bicubic".

If one, or both, of the flag_null of the two images is set, the operation will be skipped whenever a null data pixel is encountered.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Image} ret  =  object.COMPMAX({Image} argm1)

For class Image_flt

{Image_flt} ret  =  object.COMPMAX({Image_flt} argm1)

For class Image_int

{Image_int} ret  =  object.COMPMAX({Image_int} argm1)

For class Image_sht

{Image_sht} ret  =  object.COMPMAX({Image_sht} argm1)

For class Image_uch

{Image_uch} ret  =  object.COMPMAX({Image_uch} argm1)

For class Image_bln

{Image_bln} ret  =  object.COMPMAX({Image_bln} argm1)

argm1 = Image whose elements values are to be compared to those of the calling Image

Example:

->C = A.compmax(B)

->

See also (class function)

compmin

| HOME | BACK |


COMPMIN

| HOME | BACK |

Purpose

To compare elements of two Images, and store the minimum value in a new Image. 

The function first determines the spatial area where the two images are overlap, by using the function "overlap".  Hence the result image has the same resolution as the calling image.  Then the requested operation is done by getting two data from the two image at the same coordinate, using the current interpolation method set by command "set intp_mode".  Available interpolation modes are "nearest", "bilinear", and "bicubic".

If one, or both, of the flag_null of the two images is set, the operation will be skipped whenever a null data pixel is encountered.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Image} ret  =  object.COMPMIN({Image} argm1)

For class Image_flt

{Image_flt} ret  =  object.COMPMIN({Image_flt} argm1)

For class Image_int

{Image_int} ret  =  object.COMPMIN({Image_int} argm1)

For class Image_sht

{Image_sht} ret  =  object.COMPMIN({Image_sht} argm1)

For class Image_uch

{Image_uch} ret  =  object.COMPMIN({Image_uch} argm1)

For class Image_bln

{Image_bln} ret  =  object.COMPMIN({Image_bln} argm1)

argm1 = Image whose elements values are to be compared to those of the calling Image

Example:

->C = A.compmin(B)

->

See also (class function)

compmax

| HOME | BACK |


COVERAGE

| HOME | BACK |

Purpose

To report the width and height of the image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Pt2D} ret  =  object.COVERAGE()

Example:

->Img = Image(3,5)

->print Img.coverage()

    (   5.000 ,    3.000)

See also (class function)

nrow, ncol

| HOME | BACK |