Image Class Function Manual (G-I)

GENMATX

| HOME | BACK |

Purpose

To generate a double matrix object, in which each element of the matrix contains the x coodinate value of the coresponding pixel of the calling image. 

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Matrix} ret  =  object.GENMATX( )

For class Image_flt

{Matrix} ret  =  object.GENMATX( )

For class Image_int

{Matrix} ret  =  object.GENMATX( )

For class Image_sht

{Matrix} ret  =  object.GENMATX( )

For class Image_uch

{Matrix} ret  =  object.GENMATX( )

For class Image_bln

{Matrix} ret  =  object.GENMATX( )

Example:

->set precision 3
->a = image(2,3,100,100)
->a.genmatx()

ans =

no of row : 2
no of column : 3

0: 100.500 101.500 102.500
1: 100.500 101.500 102.500



->

See also (class function)

genmaty

| HOME | BACK |


GENMATY

| HOME | BACK |

Purpose

To generate a double matrix object, in which each element of the matrix contains the y coodinate value of the coresponding pixel of the calling image. 

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{Matrix} ret  =  object.GENMATY( )

For class Image_flt

{Matrix} ret  =  object.GENMATY( )

For class Image_int

{Matrix} ret  =  object.GENMATY( )

For class Image_sht

{Matrix} ret  =  object.GENMATY( )

For class Image_uch

{Matrix} ret  =  object.GENMATY( )

For class Image_bln

{Matrix} ret  =  object.GENMATY( )

Example:

->a = image(2,3,100,100)
->a.genmaty()

ans =

no of row : 2
no of column : 3

0: 101.500 101.500 101.500
1: 100.500 100.500 100.500



->

See also (class function)

genmatx

| HOME | BACK |


GOGET

| HOME | BACK |

Purpose

To get a value of an element at a particular index in a matrix of an Image.  The Image must be virtually loaded, by using a function "vload". 

Function "vload" does not really load data into memory, therefore, this function simply go to the required position and read data directly from the file.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

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

For class Image_flt

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

For class Image_int

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

For class Image_sht

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

For class Image_uch

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

For class Image_bln

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

argm1 = row number

argm2 = column number

Example:

->a = A.goget(20,360)

->

See also (class function)

goset, gosetmat

| HOME | BACK |


GOSET

| HOME | BACK |

Purpose

To set a value of an element at a particular index in a Matrix of an Image.  The Image must be virtually loaded, by using a function "vload". 

Function "vload" does not really load data into memory, therefore, this function simply go to the required position and write data directly to the file.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{void} object.GOSET({int} argm1, {int} argm2, {double} argm3)

For class Image_flt

{void} object.GOSET({int} argm1, {int} argm2, {float} argm3)

For class Image_int

{void} object.GOSET({int} argm1, {int} argm2, {int} argm3)

For class Image_sht

{void} object.GOSET({int} argm1, {int} argm2, {short} argm3)

For class Image_uch

{void} object.GOSET({int} argm1, {int} argm2, {uchar} argm3)

For class Image_bln

{void} object.GOSET({int} argm1, {int} argm2, {bool} argm3)

argm1 = row number

argm2 = column number

argm3 = a new value set at the particular index

Example:

->A.goset(20,360, 999.999)

->

See also (class function)

goget, gosetmat

| HOME | BACK |


GOSETMAT

| HOME | BACK |

Purpose

To set new values of elements in a particular portion in a Matrix of an Image.  An index at which the upper left corner of the sub-matrix to be placed is specified by the user.  The Image must be virtually loaded, by using a function "vload". 

Function "vload" does not really load data into memory, therefore, this function simply go to the required positions and write data directly to the file.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

{void} object.GOSET({int} argm1, {int} argm2, {Matrix} argm3)

For class Image_flt

{void} object.GOSET({int} argm1, {int} argm2, {Matrix_flt} argm3)

For class Image_int

{void} object.GOSET({int} argm1, {int} argm2, {Matrix_int} argm3)

For class Image_sht

{void} object.GOSET({int} argm1, {int} argm2, {Matrix_sht} argm3)

For class Image_uch

{void} object.GOSET({int} argm1, {int} argm2, {Matrix_uch} argm3)

For class Image_bln

{void} object.GOSET({int} argm1, {int} argm2, {Matrix_bln} argm3)

argm1 = row number of a point at which the upper left window is located

argm2 = column number of a point at which the upper left window is located

argm3 = a matrix whose values is to be copied onto the calling image's matrix

Example:

->a = Image(3,3)

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

->a.matrix() = A

->a.save("img_1")

->a.vload("img_1")

Image virtually loaded...

->b = [10 20; 30 40]

->print b

 no of row    : 2
 no of column : 2

 0:   10.00000   20.00000
 1:   30.00000   40.00000
 

->a.gosetmat(1,1,b)

->a.close()

->a.load("img_1")

->print a.matrix()


 no of row    : 3
 no of column : 3

 0:    1.00000    2.00000    3.00000
 1:    4.00000   10.00000   20.00000
 2:    7.00000   30.00000   40.00000

See also (class function)

goget, goset

| HOME | BACK |


HISTMATCH

| HOME | BACK |

Purpose

To perform a histogram matching. 

The function requires one argument, an Image to which the histogram of the original matrix, the calling matrix, to be matched.  The result is a lookup table, stored as a VecIndx object, in which the first number is the value of the original Image and the second number is the new value that will match the value of the second Image, in order to make the histogram of the original Image look like that of the second Image.

The result VecIndx object can be used directly in the function "lookup", where a new Image will be created according to the lookup table using original Image values.

Class

Image_int, Image_sht, Image_uch

Usage

{VecIndx} ret  =  object.HISTMATCH({Image_uch} argm1)

argm1 = image whose histogram being matched by the calling image

Example:

->a = Image_uch()

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

->a.matrix() = A


->print a.matrix()

 no of row    : 3
 no of column : 3

 0:    1    2    3
 1:    4    5    6
 2:    7    8    9

->b = a * uchar(10)
->print b.matrix()

 no of row    : 3
 no of column : 3

 0:    10   20   30
 1:    40   50   60
 2:    70   80   90


->v = a.histmatch(b)
->print v

Vector of Index (row, column)...

list id : 0

Vector size : 9

(1 , 10)
(2 , 20)
(3 , 30)
(4 , 40)
(5 , 50)
(6 , 60)
(7 , 70)
(8 , 80)
(9 , 90)

See also (class function)

reclass, reassign, lookup

| HOME | BACK |


HISTO

| HOME | BACK |

Purpose

To create a histogram of an Image. 

The result is a two-column matrix, in which the first column are values of the center of bins and the second column are cumulative frequency of bins.  The result can be later exported to an ASCII file so that a histogram plot can be generated by a general graphic-displayable program.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Matrix} ret  =  object.HISTO([{double} argm1, {double} argm2, {double} argm3])

argm1 = start value of bins (default = minimum value)

argm2 = end value of bins   (default = maximum value)

argm3 = bin size            (default = a size that generates 10 bins)

Example:

->a = Image(3,3)

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

->a.matrix() = A

->b = a.histo(1,9,3)

->print b

 no of row    : 3
 no of column : 2

 0:    2.50000    3.00000
 1:    5.50000    3.00000
 2:    8.50000    3.00000

See also (class function)

reclass, reassign

| HOME | BACK |


ID

| HOME | BACK |

Purpose

To report an ID of an Image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{int} ret  =  object.ID()

Example:

->id = Img.id()

->

See also (class function)

lower_left, upper_right, proj

| HOME | BACK |


INCDANG

| HOME | BACK |

Purpose

To calculate incident angles of an Image.  The calling image is thought to be a DEM (Digital Elevation Model).  The determined incident angles are from a light source, for example the sun, at a particular position, defined by an altitude and an azimuth. 

In case of the sun as a light source, its position is not constant, depending on the observed position on the earth as well as the observation time.  Please refer to class "Sun" to determine its dynamic position.

The unit of angle used to define the light source position is the current unit of angle set by command "set angle".

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image} ret  =  object.INCDANG([{double} argm1, {double} argm2])

argm1 = altitude of the sun (default = 45)

argm2 = azimuth of the sun (default = 45)

Example:

->Img_incd = DEM.incdang(40,135)

->

See also (class function)

shadrelf

| HOME | BACK |


INIT

| HOME | BACK |

Purpose

To initialize a Matrix object, to have a specified size and an initial value.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{void} object.INIT({int} argm1, {int} argm2, [{double} argm3,{double} argm4,{double} argm5,{double} argm6,{Projection} argm7])

argm1 = no of rows

argm2 = no of columns

argm3 = x coordinate of lower left corner    (default = 0)

argm4 = y coordinate of lower left corner    (default = 0)

argm5 = x coordinate of upper right corner   (default = no of columns)

argm6 = y coordinate of upper right corner   (default = no of rows)

argm7 = map projection   (default = default map projection of class "Projection")

Example:

->A.init(100,200, 1456298.789, 665276.456,1462298.789,668276.456 )

->print A

 

See also (class function)

blank, set

| HOME | BACK |


INT

| HOME | BACK |

Purpose

To convert to an Image_int object.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{Image_int} ret  =  object.INT()

Example:

->A_new = A.int()

->

See also (class function)

double, float, short, uchar, bool

| HOME | BACK |


INTERSECT

| HOME | BACK |

Purpose

To create a blank image from an intersection of two images.  The two images must be in the same map projection.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

For class Image

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

For class Image_flt

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

For class Image_int

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

For class Image_sht

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

For class Image_uch

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

For class Image_bln

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

argm1 = The intersecting image

Example:

->new_blank_img = Img_1.intersect(Img_2)

->

See also (class function)

overlay, overlap

| HOME | BACK |


INTPDIST

| HOME | BACK |

Purpose

To do an interpolation to fill up values of all pixels in the image according to a given set of 3D points.  The interpolation method is weighted average by inverse distances from known points to the point being evaluated.  When flag_null is set, pixels in the image that have null data will not be calculated.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

{void} object.INTPDIST({VecPt3D} argm1, [{int} argm2])

argm1 = list of given x y z coordinates

argm2 = polynomial degree of inverse distance    (default = 2)

Example:

->DEM.intpdist(vec_spot_height)

->

See also (class function)

intpnearest

| HOME | BACK |


INTPNEAREST

| HOME | BACK |

Purpose

To do an interpolation to fill up values of all pixels in the image according to a given set of 3D points.  The interpolation method is nearest neighbor.  When flag_null is set, pixels in the image that have null data will not be calculated.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

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

argm1 = list of given x y z coordinates

Example:

->DEM.intpnearest(vec_spot_height)

->

See also (class function)

intpdist

| HOME | BACK |


IS_COVER

| HOME | BACK |

Purpose

To determine whether a point is covered by an image.

Class

Image, Image_flt, Image_int, Image_sht, Image_uch, Image_bln

Usage

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

argm1 = x coordinate of a point being determined

argm2 = y coordinate of a point being determined

Example:

->b1 = img.is_cover(667256.001, 458986.356)

->

See also (class function)

 

| HOME | BACK |