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 20 lines, otherwise 21 lines.

 Photo

/ Document file of a Photo object

/ Photo id

0

/ Photo name

no name

/ no of row

3648

/ no of column

5472

/ lower left coordinate (X Y image coord system)

-10.944000 -7.296000

/ upper right coordinate (X Y image coord system)

10.944000 7.296000

/ camera id

0

/ camera name

Nokia Lumia630

/ calibrated focal length (mm)

10.030000

/ calibrated principal point coordinate (X Y)

0.000000 0.000000

/ list of fiducial marks (mm)

(-9 4.00000e-003 4.00000e-003 0.00000e+000)

+ (-9 0.00000e+000 0.00000e+000 0.00000e+000)

+ (-9 0.00000e+000 0.00000e+000 0.00000e+000)

+ (-9 0.00000e+000 0.00000e+000 0.00000e+000)



/ GPS offset (X Y Z) in mm

0.00000 0.00000 0.00000

/ (for analog camera) Radial lens distortion (mm)


/ Forward IO parameters (For analog and digital cameras. In case of digital camera, forward IO has 7 elements descripting lens distortions.

/ Lens distortion model from Beyer(1992) => k1, A1, p1, k2, A2, p2, k3)

0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000

/ Backward IO parameters (For analog cameras, not use in case of a digital camera)

0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000 0.00000e+000

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

3.595792031636467e+002 3.575916367553488e+002 2.657758835428592e+002 664977.426 1519896.477 68.379

/ flag Rotation - original image has been rotated or not (0=no 1=90 2=180 3=270 degrees clockwise)

0

/ flag lens radial distortion correction (0 = NO 1=YES)

1

/ flag atmospheric correction (0 = NO 1=YES)

0

/ flag earth curvature correction (0 = NO 1=YES)

0
 

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 |


SAVE2SIM

| HOME | BACK |

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

| 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 |