|
Image_rgb Class Function Manual |
Purpose
To return a matrix of the blue color of the image.
Class
Image_rgb
Usage
{Matrix_uch} ret = object.B()
Example:
|
->blue = Img.B() -> |
See also (class function)
R, G
Purpose
To create a blank image. Spatial information is also copied to the created blank image.
Class
Image_rgb
Usage
{Image_uch} ret = object.BLANK([{uchar} argm1])
argm1 = initial value of the blank image
(default threshold value = 0)
See an example in function "BLANK" of class Image
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_rgb
Usage
{double} ret = object.COL2X({double} argm1)
argm1 = column number
See an example in function "COL2X" of class Image
Purpose
To report the width and height of the image.
Class
Image_rgb
Usage
{Pt2D} ret = object.COVERAGE()
See an example in function "COVERAGE" of class Image
Purpose
To draw a circle in an Image.
Class
Image_rgb
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)
See an example in function "DRWCIRCLE" of class Image
Purpose
To draw an ellipse in an Image.
Class
Image_rgb
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)
See an example in function "DRWELLIPSE" of class Image
Purpose
To draw an line in an Image.
Class
Image_rgb
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
See an example in function "DRWLINE" of class Image
Purpose
To draw a poly-line in an Image.
Class
Image_rgb
Usage
{void} object.DRWPLINE({VecPt2D} argm1)
argm1 = list of x y coordinates of a poly-line, stored in a VecPt2D object
See an example in function "DRWPLINE" of class Image
Purpose
To draw a point in an Image.
Class
Image_rgb
Usage
{void} object.DRWPOINT({double} argm1, {double} argm2)
argm1 = x coordinate of the point
argm2 = y coordinate of the point
See an example in function "DRWPOINT" of class Image
Purpose
To draw a rectangle in an Image.
Class
Image_rgb
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)
See an example in function "DRWRECTANG" of class Image
Purpose
To draw a square in an Image.
Class
Image_rgb
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)
See an example in function "DRWSQUARE" of class Image
Purpose
To draw a list of circles in an Image.
Class
Matrix_uch
Usage
{void} object.DRWSQUARE({VecIndx} 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_rgb
Usage
{void} object.DRWVECPLINE({VecXYpline} argm1)
argm1 = vector of poly-lines, stored in a VecXYpline object.
See an example in function "DRWVECPLINE" of class Image
Purpose
To draw a text in a matrix.
Class
Image_rgb
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 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_rgb
Usage
{void} object.FILLPOLY({VecPt2D} argm1)
argm1 = list of x y coordinates of a polygon, stored in a VecPt2D object.
See an example in function "FILLPOLY" of class Image
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_rgb
Usage
{bool} ret = object.FLAG_NULL()
See an example in function "FLAG_NULL" of class Image
Purpose
To return a matrix of the green color of the image.
Class
Image_rgb
Usage
{Matrix_uch} ret = object.G()
Example:
|
->blue = Img.G() -> |
See also (class function)
R, B
Purpose
To transform to HSV (Hue Saturation Value) matrix, a Matrix_flt, consisting of 3 matrices concatenated to together. The size of the returning matrix is, therefore, 3m * n, where m is no of rows and n is no of columns.
The matrix at the top, of size equal to the original image, is a Hue matrix. A hue matrix has values from 0 to 360 degrees, which represent for all variety of colors. At the point where hue value is 0, the represented color is red. At the point where hue value is 120, the represented color is green. At the point where hue value is 240, the represented color is blue.
The middle matrix is a matrix containing values representing for saturation. They are information about how saturate a the color is. The range of saturation is from 0 to 1.
The bottom matrix is a matrix containing values representing for Value. These are information about the brightness of each color. The range of Value is from 0 to 1.
Class
Image_rgb
Usage
{Matrix_flt} ret = object.HSV()
Example:
|
->Mat_hsv = Img.HSV() -> |
See also (class function)
hsv2rgb (global function)
Purpose
To report an ID of an Image.
Class
Image_rgb
Usage
{int} ret = object.ID()
See an example in function "ID" of class Image
Purpose
To initialize a Matrix object, to have a specified size and an initial value.
Class
Image_rgb
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")
See an example in function "INIT" of class Image
Purpose
To convert to an Image_int object.
Class
Image_rgb
Usage
{Image_int} ret = object.INT()
See an example in function "INT" of class Image
Purpose
To load an Image object saved as Noobeed format. There are 2 files needed. One is for the documentation, and it is an ASCII file. The other is a binary file containing data of the matrix.
If file name extensions are omitted, the function will add default extensions to the files. The default extension of the documentation file is ".txt" and that of the data file is ".raw".
Unless the path name is given in the file names, the function will search for the files in the current working directory, defined by command "set path".
The detail structure of the documentation file is described in function "save".
Class
Image_rgb
Usage
{void} object.LOAD({String} argm1, [{String} argm2])
argm1 = file name for the documentation file (default extension is ".txt")
argm2 = file name for the data file
(default file name is same file name as argm1 with an extension ".raw")
See an example in function "LOAD" of class Image
Purpose
To load data from a bitmap (BMP) file and stored in an Image object.
If file name extension is omitted, the function will add default extensions to the files. The default extension of a bitmap file is ".bmp".
Unless the path name is given in the file names, the function will search for the files in the current working directory, defined by command "set path".
This function requires that the data is of 24-bit and with no compression. If the data is of type 8 bit, gray scale, then the R, G, B matrices will have the same value.
Class
Image_rgb
Usage
{void} object.LOADBMP({String} argm1)
argm1 = file name for the bitmap file (default extension is ".bmp")
See an example in function "LOADBMP" of class Image
Purpose
To load data from a Tag Image File (TIF) file and stored in an Image object.
If file name extension is omitted, the function will add default extensions to the files. The default extension of a bitmap file is ".tif".
Unless the path name is given in the file names, the function will search for the files in the current working directory, defined by command "set path".
This function requires that the data is of 24-bit color image and with no compression. If the data is of type 8 bit, gray scale, then the R, G, B matrices will have the same value.
Class
Image_rgb
Usage
{void} object.LOADTIF({String} argm1)
argm1 = file name for the TIF file (default extension is ".tif")
See an example in function "LOADTIF" of class Image
Purpose
To report x y coordinate of the lower left corner of the image.
Class
Image_rgb
Usage
{Pt2D} ret = object.LOWER_LEFT()
See an example in function "LOWER_LEFT" of class Image
Purpose
To report x y coordinate of the lower right corner of the image.
Class
Image_rgb
Usage
{Pt2D} ret = object.LOWER_RIGHT()
See an example in function "LOWER_RIGHT" of class Image
Purpose
To report the number of columns of an Image.
Class
Image_rgb
Usage
{int} ret = object.NCOL()
See an example in function "NCOL" of class Image
Purpose
To report the number of rows of an Image.
Class
Image_rgb
Usage
{int} ret = object.NROW()
See an example in function "NROW" of class Image
Purpose
To report the current value of null data of an Image.
Class
Image_rgb
Usage
{double} ret = object.NULLDATA()
See an example in function "NULLDATA" of class Image
Purpose
To report the current map projection of the image.
Class
Image_rgb
Usage
{Projection} ret = object.PROJ()
See an example in function "PROJ" of class Image
Purpose
To return a matrix of the red color of the image.
Class
Image_rgb
Usage
{Matrix_uch} ret = object.R()
Example:
|
->blue = Img.R() -> |
See also (class function)
B, G
Purpose
To convert from a row and column number to an x y coordinate. Please note that the arguments of the function are of type double, which allows a sub-pixel row and column number to be converted to an accurate x y coordinate.
Class
Image_rgb
Usage
{Pt2D} ret = object.RC2XY({double} argm1, {double} argm2)
argm1 = row number
argm2 = column number
See an example in function "RC2XY" of class Image
Purpose
To report the resolution in x axis. This is the width of the image, in x y coordinate system unit, divided by no of columns.
Class
Image_rgb
Usage
{double} ret = object.RES_X()
See an example in function "RES_X" of class Image
Purpose
To report the resolution in y axis. This is the height of the image, in x y coordinate system unit, divided by no of rows.
Class
Image_rgb
Usage
{double} ret = object.RES_Y()
See an example in function "RES_Y" of class Image
Purpose
To convert to an Image_uch object, by keeping the blue color information.
Class
Image_rgb
Usage
{Image_uch} ret = object.RGB2B()
Example:
|
->Img_gray = Img.rgb2b() -> |
See also (class function)
rgb2r, rgb2g
Purpose
To convert to an Image_uch object, by keeping the green color information.
Class
Image_rgb
Usage
{Image_uch} ret = object.RGB2G()
Example:
|
->Img_gray = Img.rgb2g() -> |
See also (class function)
rgb2r, rgb2b
Purpose
To convert to an Image_uch object, by keeping the red color information.
Class
Image_rgb
Usage
{Image_uch} ret = object.RGB2R()
Example:
|
->Img_gray = Img.rgb2r() -> |
See also (class function)
rgb2b, rgb2g
Purpose
To convert from a row number to a y coordinate. Please note that the arguments of the function are of type double, which allows a sub-pixel row number to be converted to an accurate y coordinate.
Class
Image_rgb
Usage
{double} ret = object.RC2XY({double} argm1)
argm1 = row number
See an example in function "ROW2Y" of class Image
Purpose
To save as Noobeed format. The function creates two files, one for documentation and another for data.
The documentation file will have an extension ".txt". It is actually an ASCII file and must have exactly 15 lines (not including comment lines) , as follows.
|
The data file is in fact a generic binary file. However since there are 3 matrices to stored, which are red, green and blue matrix, they will be stacked together, by first writing all data for the red matrix, followed by the green matrix, and finally the blue matrix.
if a file name extension is not given, the function assumes an extension of ".txt" for documentation file and ".raw" for data file.
if a path name is not include in the specified file name, the function will search in the current data path, set by command "set path".
Class
Image_rgb
Usage
{void} object.SAVE({String} argm1, [{String} argm2])
argm1 = documentation file name
argm2 = data file name (default = same name as argm1 with extension ".raw")
See an example in function "SAVE" of class Image
Purpose
To save as bitmap (BMP) format. The image will be first converted to an 8-bit data, and the output file will have an 8-bit gray scale format. Losing of accuracy of data is unavoidable, if the original value range of data is beyond 8 bit, 0 to 255.
if a file name extension is not given, the function assumes an extension of ".bmp".
if a path name is not include in the specified file name, the function will search in the current data path, set by command "set path".
Class
Image_rgb
Usage
{void} object.SAVEBMP({String} argm1)
argm1 = output file name
See an example in function "SAVEBMP" of class Image
Purpose
To save as Tag Image File (TIF) format. The Image will be first converted to an 8-bit data, and the output file will have an 8-bit gray scale format. Losing of accuracy of data is unavoidable, if the original value range of data is beyond 8 bit, 0 to 255.
if a file name extension is not given, the function assumes an extension of ".tif".
if a path name is not include in the specified file name, the function will search in the current data path, set by command "set path".
Class
Image_rgb
Usage
{void} object.SAVETIF({String} argm1)
argm1 = output file name
See an example in function "SAVETIF" of class Image
Purpose
To set a symbol at a particular coordinate in an Image. A symbol is realized by using a matrix, which is one of arguments given by the user.
Class
Image_rgb
Usage
{void} object.SETSYMB({double} argm1, {double} argm2, {Matrix_uch} argm3)
argm1 = x coordinate at which the center of the symbol is placed
argm2 = x coordinate at which the center of the symbol is placed
argm3 = matrix being used as a symbol to place on the calling matrix
See an example in function "SETSYMB" of class Image
Purpose
To report the size of an Image, no of rows and columns.
Class
Image_rgb
Usage
{Indx} ret = object.SIZE()
See an example in function "SIZE" of class Image
Purpose
To decrease the size of an Image by skipping a certain number of rows and columns.
Class
Image_rgb
Usage
{Image_uch} ret = object.SKIP({int} argm1)
argm1 = no of rows and columns being skipped
See an example in function "SKIP" of class Image
Purpose
To perform a general linear stretching.
Class
Image_rgb
Usage
{Image_uch} ret = object.STRETCH([{double} argm1, {double} argm2])
argm1 = start value of the stretching range (default = 0)
argm2 = end value of the stretching range (default = 255)
See an example in function "STRETCH" of class Image
Purpose
To perform a stretching using histogram equalization.
Class
Matrix_uch
Usage
{Image_uch} ret = object.STRETCHEQ([{double} argm1, {double} argm2])
argm1 = start value of the stretching range (default = 0)
argm2 = end value of the stretching range (default = 255)
Example:
|
->Img_new = Img.stretcheq() -> |
See also (class function)
stretchfix, stretchsat, stretch
Purpose
To perform a linear stretching with fix interval. In other words, the stretching will be done within a specific range.
Values that are less than the specified range will be assigned the new value as the minimum value of the stretching range. Values that are larger than the specified range will be assigned the new value as the maximum value of the stretching range.
Class
Image_rgb
Usage
{Image_uch} ret = object.STRETCH({double} argm1, {double} argm2, [{double} argm3, {double} argm4])
argm1 = start value of the original range being stretched
argm2 = end value of the original range being stretched
argm3 = start value of the stretching range (default = 0)
argm4 = end value of the stretching range (default = 255)
See an example in function "STRETCHFIX" of class Image
Purpose
To perform a linear stretching with saturation.
The user gives an amount of percent, a so-called percent of saturation, say 5 percents. Then the function calculate 2 fixed values. One is the value that 5 percents of the data will have values less than it. The second one is the value that 5 percents of the data will have values larger than it. These two fixed values will be used to perform a linear stretching with fixed interval.
Class
Image_rgb
Usage
{Image_uch} ret = object.STRETCHSAT({double} argm1, [{double} argm2, {double} argm3])
argm1 = percent of saturation
argm2 = start value of the stretching range (default = 0)
argm3 = end value of the stretching range (default = 255)
See an example in function "STRETCHSAT" of class Image
Purpose
To report x y coordinate of the upper left corner of the image.
Class
Image_rgb
Usage
{Pt2D} ret = object.UPPER_LEFT()
See an example in function "UPPER_LEFT" of class Image
Purpose
To report x y coordinate of the upper right corner of the image.
Class
Image_rgb
Usage
{Pt2D} ret = object.UPPER_RIGHT()
See an example in function "UPPER_RIGHT" of class Image
Purpose
To convert from a vector of row and column numbers to a vector of x y coordinates.
Class
Image_rgb
Usage
{VecPt2D} ret = object.VECRC2XY({VecPt2D} argm1)
argm1 = list of row and column numbers
See an example in function "VECRC2XY" of class Image
Purpose
To convert poly-lines represented by row and column numbers, VecRCpline objects, to poly-lines represented by x y coordinates, VecXYpline objects.
Class
Image_rgb
Usage
{VecXYpline} ret = object.VECRCPLINE2XY({VecRCpline} argm1)
argm1 = list of poly-lines in row and column numbers
See an example in function "VECRCPLINE2XY" of class Image
Purpose
To convert from a vector of x y coordinates to a vector of row and column numbers.
Class
Image_rgb
Usage
{VecIndx} ret = object.VECXY2RC({VecPt2D} argm1)
argm1 = list of x y coordinates
See an example in function "VECXY2RC" of class Image
Purpose
To convert poly-lines represented by x y coordinates, VecXYpline objects, to poly-lines represented by row and column numbers, VecRCpline objects.
Class
Image_rgb
Usage
{VecRCpline} ret = object.VECXYPLINE2RC({VecXYpline} argm1)
argm1 = list of poly-lines in x y coordinates
See an example in function "VECXYPLINE2RC" of class Image
Purpose
To convert from a vector of IdIndx objects, ID with row and column numbers, to a vector of IDPt2D, ID with x y coordinates.
Class
Image_rgb
Usage
{VecIdPt2D} ret = object.VIDRC2XY({VecIdPt2D} argm1)
argm1 = list of ID, row, and column numbers
See an example in function "VIDRC2XY" of class Image
Purpose
To convert from a vector of IDPt2D, ID with x y coordinates, to a vector of IdIndx objects, ID with row and column numbers.
Class
Image_rgb
Usage
{VecIdIndx} ret = object.VIDXY2RC({VecIdPt2D} argm1)
argm1 = list of ID, x and y coordinates
See an example in function "VIDXY2RC" of class Image
Purpose
To virtually load an Image object, saved as Noobeed format. The document file is read but the data file. The function simply opens the data file and get ready to perform some functions.
Please note that only a limited set of functions is available for a virtually loaded matrix. Function supported in a vload matrix are goget, goset, gosetmat, window, skip, stretch, stretchfix, min, max, mean, sd, var, and those function that do not requated data, such as nrow, ncol, rc2xy, xy2rc etc.
Class
Image_rgb
Usage
{void} object.VLOAD({String} argm1, [{String} argm2])
argm1 = file name for the documentation file (default extension is ".txt")
argm2 = file name for the data file
(default file name is same file name as argm1 with an extension ".raw")
See an example in function "VLOAD" of class Image
Purpose
To cut a window out of an Image. This function does not perform resample, therefore the result window image is the nearest possible to the required cutting window. If an exact window of image is wanted, the user can prepare a desired blank image and use function "overlay" to get the result.
Class
Image_rgb
Usage
{Image_uch} ret = object.WINDOW({double} argm1, {double} argm2, {double} argm3, {double} argm4)
argm1 = x coordinate of the lower left corner of the window
argm2 = y coordinate of the lower left corner of the window
argm3 = x coordinate of the upper right corner of the window
argm4 = y coordinate of the upper right corner of the window
See an example in function "WINDOW" of class Image
Purpose
To convert from an x coordinate to a column number.
Class
Image_rgb
Usage
{int} ret = object.X2COL({double} argm1)
argm1 = x coordinate
See an example in function "X2COL" of class Image
Purpose
To convert from an x y coordinate to row and column index number.
Class
Image_rgb
Usage
{Index} ret = object.XY2RC({double} argm1, {double} argm2)
argm1 = x coordinate
argm2 = y coordinate
See an example in function "XY2RC" of class Image
Purpose
To convert from a y coordinate to a row number.
Class
Image_rgb
Usage
{int} ret = object.Y2ROW({double} argm1)
argm1 = y coordinate
See an example in function "Y2ROW" of class Image