Photo Class Function Manual (Q-S) |
Purpose
To convert from a row and column number of a point on a photo to an x y z ground control coordinate. Please note that the arguments of the function are of type double, which allows a sub-pixel row and column number as input.
Only row and column number is not enough, since the light ray projected from the photo can go for ever. Thus this function also needs a ground elevation value, to make a plane so that the light ray from the photo can intersect the ground.
Class
Photo
Usage
{Pt3D} ret = object.RC2XY({double} argm1, {double} argm2, {double} argm3)
argm1 = row number (in pixel unit)
argm2 = column number (in pixel unit)
argm3 = ground elevation (in ground coordinate system unit)
Example:
->pt_xyz = ph1.rc2gcp(12.544, 22.986, 600)
-> |
See also (class function)
gcp2rc, vecgcp2rc, vecrc2gcp
Purpose
To convert from a row and column number of a point on a photo to an x y photo coordinate. Please note that the arguments of the function are of type double, which allows a sub-pixel row and column number as input.
Class
Photo
Usage
{Pt2D} ret = object.RC2XPYP({double} argm1, {double} argm2)
argm1 = row number (in pixel unit)
argm2 = column number (in pixel unit)
Example:
->pt = ph1.rc2xpyp(60, 1025)
-> |
See also (class function)
xpyp2rc, vecxpyp2rc, vecrc2xpyp
Purpose
To convert from a row and column number of a point on a photo to an x y image rectangular coordinate. Please note that the arguments of the function are of type double, which allows a sub-pixel row and column number as input.
Class
Photo
Usage
{Pt2D} ret = object.RC2XYP({double} argm1, {double} argm2)
argm1 = row number (in pixel unit)
argm2 = column number (in pixel unit)
Example:
->pt = ph1.rc2xy(100,250)
-> |
See also (class function)
xy2rc
Purpose
To rectify a Photo, using rigorous collinearity transformation but without a Digital Elevation Model (DEM). This technique is suitable when the terrain is flat, having a constant elevation.
In classical rectification, there is a possibility to make a rectified map of a tilt flat terrain. However this cannot be done by this function. The solution to this, is to create an Image object and use class function "rectify" of Image with an option for the mathematic model of "PJTIVE", perspective transformation.
The boundary of the result rectified image is determined automatically, using a specified resolution and a specified ground elevation, given by the user. If an image is to be rectified onto a pre-defined blank image, the function "rectify2img" must be used instead.
Class
Photo
Usage
{Image_uch} ret = object.RECTIFY({double} argm1, {double} argm2, [{String} argm3])
argm1 = required resolution of the result image (in ground unit)
argm2 = ground elevation (in ground unit)
argm3 = resample method, must be "nearest" or "bilinear" or "bicubic"
(default = "nearest")
Example:
->Img_new = ph1.rectify(20, 500, "bicubic") -> |
See also (class function)
rectify2img
Purpose
To rectify a Photo, using rigorous collinearity transformation but without a Digital Elevation Model (DEM). The result image will have the same size and resolution as the template image specified in one of the function arguments.
The function is similar to function "rectify", except that it will create a new image, by using information from the image in the first argument, to store the rectified image.
This function can be used to fully control the size and resolution of the output rectified image. Hence the target result image can be generated before hand according to a certain specification, for example resolution, coordinates of lower left and upper right corner. Then it will be input as one of the argument in the function. The result rectified image will have exactly the same geometry as the pre-defined image.
All other detail explanations are same as that of function "rectify" and can be seen in function "rectify".
Class
Photo
Usage
{Image_uch} ret = object.RECTIFY2IMG({Image_uch} argm1, {double} argm2, [{String} argm3])
argm1 = template image for the result rectified image (in ground unit)
argm2 = ground elevation (in ground unit)
argm3 = resample method, must be "nearest" or "bilinear" or "bicubic"
(default = "nearest")
Example:
->Img_new = ph1.rectify2img(Img_new, 500.50, "bicubic") -> |
See also (class function)
rectify
Purpose
To report the mean resolution of a photo, in photo coordinate unit.
Class
Photo
Usage
{double} ret = object.RES()
Example:
->resolution = ph1.res() -> |
See also (class function)
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 16 or 17 lines (not including comment lines) , as below. When the lens distortion data are not given, the photo documentation file will have only 20 lines, otherwise 21 lines.
|
Please notice the lower left and upper right coordinates. They are actually x y image rectangular coordinates. The lower left will be normally x = 0, y = 0, while the upper right will be x = no of columns, y = no of rows. However, this photo was cut, using function "window", and the corner points must carry old x y image rectangular coordinates with them.
The data file is in fact a generic binary file. First it stores all element of the first row of the matrix of the image, from the first to the last column, then go to the second row, and does the same thing. Hence the size of the data file will be exactly equal to total number of elements of the image multiplied by no of bytes per element (1 bytes in this case).
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
Photo
Usage
{void} object.SAVE({String} argm1, [{String} argm2])
argm1 = documentation file name
argm2 = data file name (default = same name as argm1 with extension ".raw")
Example:
->ph1.save("photo_no_6175") -> |
See also (class function)
load
SAVE2SIM
Purpose
This function generates a document file and a BMP grey scale image file to view in SIM (Stereo Image Mapper) software. This output document file is an old version doc file of Noobeed, in which there iare 16 or 17 lines in total.
Class
Photo
Usage
{void} object.SAVE2SIM({String} argm1)
argm1 = output file name
Example:
->ph1.save2sim("photo_no_6175") -> |
See also (class function)
savetif
SAVEBMP
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
Photo
Usage
{void} object.SAVEBMP({String} argm1)
argm1 = output file name
Example:
->ph1.savebmp("photo_no_6175") -> |
See also (class function)
savetif
Purpose
To save only information of a Photo to a documentation file. The documentation file will have an extension ".txt". It is actually an ASCII file and must have exactly 16 or 17 lines, see details in function "save".
Class
Photo
Usage
{void} object.SAVEDOC({String} argm1)
argm1 = output file name (default extension = ".txt")
Example:
->ph1.savedoc("photo_no_6175") -> |
See also (class function)
save
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
Photo
Usage
{void} object.SAVETIF({String} argm1)
argm1 = output file name
Example:
->ph1.savetif("photo_no_6175") -> |
See also (class function)
savebmp
Purpose
To determine the value of the standard deviation of all elements in a photo.
Class
Photo
Usage
{double} ret = object.SD()
Example:
->sd = ph1.sd() -> |
See also (class function)
max, min, mean
Purpose
To set a symbol at a particular x y photo coordinate in a Photo. A symbol is realized by using a matrix, which is one of arguments given by the user.
Class
Photo
Usage
{void} object.SETSYMB({double} argm1, {double} argm2, {Matrix} argm3)
argm1 = x photo coordinate at which the center of the symbol is placed
argm2 = y photo coordinate at which the center of the symbol is placed
argm3 = matrix being used as a symbol to place on the calling matrix
Example:
->A = [ 0 1 0; 1
1 1; 0 1 0 ] |
See also (class function)
setvecsymb
Purpose
To set a symbol at particular x y photo coordinate, specified by a VecPt2D object. A symbol is realized by using a matrix, which is one of arguments given by the user.
Class
Photo
Usage
{void} object.SETVECSYMB({VecPt2D} argm1, {Matrix_uch} argm2)
argm1 = a vector contains x y photo coordinates of centers of the symbol
argm2 = matrix being used as a symbol to place on the calling image
Example:
->A = [ 0 1 0; 1
1 1; 0 1 0 ] |
See also (class function)
setsymb
Purpose
To report the size of a Photo, no of rows and columns.
Class
Photo
Usage
{Indx} ret = object.SIZE()
Example:
->ph1.size() ans = (3000 , 3000) |
See also (class function)
nrow, ncol
Purpose
To decrease the size of a Photo by skipping a certain number of rows and columns.
Class
Photo
Usage
{Photo} ret = object.SKIP({int} argm1)
argm1 = no of rows and columns being skipped
Example:
->a = photo(100,100) ->b = a.skip(1) ->print b.size() (50 , 50) |
See also (class function)
pyramid
Purpose
To compute the summation value of all elements in a Photo.
Class
Photo
Usage
{double} ret = object.SUM()
Example:
->x = ph1.sum() -> |
See also (class function)
max, min, mean