Photo Class Function Manual (Q-S)

RC2GCP

| HOME | BACK |

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

| HOME | BACK |


RC2XPYP

| HOME | BACK |

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

| HOME | BACK |


RC2XY

| HOME | BACK |

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

| HOME | BACK |


RECTIFY

| HOME | BACK |

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

| HOME | BACK |


RECTIFY2IMG

| HOME | BACK |

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

| HOME | BACK |


RES

| HOME | BACK |

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)

 

| HOME | BACK |


SAVE

| HOME | BACK |

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 16 lines, otherwise 17 lines.

 Photo

/ Documant file of a Photo object

/ Photo id

0

/ Photo name

no name

/ no of row

1665

/ no of column

1895

/ lower left coordinate (X Y image coord system)

10703.000 8514.000

/ upper right coordinate (X Y image coord system)

12598.000 10179.000

/ camera id

0

/ camera name

Ocean City Camera WILD RC10 sn no 1777 (Wild Universal Aviogon II)

/ calibrated focal length (mm)

152.743

/ calibrated principal point coordinate (X Y)

-0.015 0.001

/ list of fiducial marks (mm)

(99996 -106.001 -106.008 0.003)

+ (99993 106.016 105.997 0.003)

+ (99991 -105.993 106.000 0.003)

+ (99998 106.006 -106.008 0.003)

+ (99994 -109.993 -0.003 0.003)

+ (99995 110.005 -0.003 0.003)

+ (99992 0.006 109.994 0.003)

+ (99997 0.001 -110.004 0.003)



/ GPS offset (X Y Z) in mm

0.000 0.000 0.000

/ Radial lens distortion (mm)


/ Forward IO parameters (image to photo coor system)

0.013998029887785 0.000045221247985 -0.000045399905621 0.013997978163217 -115.545 -113.674

/ Backward IO parameters (photo to image coor system)

71.437875759538343 -0.230783985516939 0.231695854316520 71.438139431209862 8228.046 8147.439

/ EO parameters (omega(deg) phe(deg) kappa(deg) Xo Yo Zo)

0.000000000000000 0.000000000000000 0.000000000000000 0.000 0.000 0.000

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

| HOME | BACK |


SAVEBMP

| HOME | BACK |

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

| HOME | BACK |


SAVEDOC

| HOME | BACK |

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

| HOME | BACK |


SAVETIF

| HOME | BACK |

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

| HOME | BACK |


SD

| HOME | BACK |

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

| HOME | BACK |


SETSYMB

| HOME | BACK |

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 ]
->ph1.setsybm(100.5 ,20.256, A)
->

See also (class function)

setvecsymb

| HOME | BACK |


SETVECSYMB

| HOME | BACK |

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 ]
->ph1.setvecsybm(vec_center_point, A)
->

See also (class function)

setsymb

| HOME | BACK |


SIZE

| HOME | BACK |

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

| HOME | BACK |


SKIP

| HOME | BACK |

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

| HOME | BACK |


SUM

| HOME | BACK |

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

| HOME | BACK |