Photo Class Function Manual (A-D)

(  )

| HOME | BACK |

Purpose

To get a value of an element at a particular index, row and column number, in a Photo.

Class

Photo

Usage

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

argm1 = row number

argm2 = column number

Example:

->a = matrix_uch(200,300)
->a.rand(255)
->a.savetif("temp")
->ph1 = Photo()
->ph1.loadtif("temp")


Tif Image format Type II(little-endian) confirm
no of entry in this block : 9
no of entry read : 9
no of row : 200
no of column : 300
no of bit per sample : 8
Compression : no
Image type : gray level
Reading done...

Warning : relation between image and photo coordinates not established (use IO to make it)...

->print ph1(0,0)
            170

See also (class function)

 

| HOME | BACK |


BICUBIC

| HOME | BACK |

Purpose

To get a value at a particular x y photo coordinate, using bi-cubic interpolation.

This function converts the input x y photo coordinate to x y image rectangular coordinate, and calls to function "bicubic" of class Image.

Class

Photo

Usage

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

argm1 = x photo coordinate

argm2 = y photo coordinate

Example:

->val = ph1.bicubic(12.544, 22.986)

->

See also (class function)

nearest, bilinear

| HOME | BACK |


BILINEAR

| HOME | BACK |

Purpose

To get a value at a particular x y photo coordinate, using bi-linear interpolation.

This function converts the input x y photo coordinate to x y image rectangular coordinate, and calls to function "bilinear" of class Image.

Class

Photo

Usage

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

argm1 = x photo coordinate

argm2 = y photo coordinate

Example:

->val = ph1.bilinear(12.544, 22.986)

->

See also (class function)

nearest, bicubic

| HOME | BACK |


CALIBXPYP

| HOME | BACK |

Purpose

To extract x y photo coordinates of all target point that appear on an the image.  The calling object is a Photo taken for the camera calibration process.  The calibration sheet is the one that specifically designed for this purpose.  Here is the download PDF file, CALIB.PDF, for the calibration drawing.  The size of the drawing is A0 (841 x 1188 mm) and when plotted should look like this.

 The targets are arranged in an array of 8 rows and 12 columns.  Each target is designed to be exactly 100 mm far apart from each other in all directions.

The Calibxpyp function needs at least five measuring input target point coordinates, in pixel coordinate system (row, column) and the list of actual coordinates of all targets point (in mm. unit).  Then a projective transformation is performed to transform all other target coordinates to pixel coordinates in the photo spaces. 

Noobeed use approximated pixel coordinate to extract each individual target for the final step, finding the center of the target automatically.  The Generalized Hough Transform technique is used to find one horizontal line and one vertical line.  Then the equation the two two lines are determind using Least Squares fitting.  Finally the intersection point, hence the target center, is calculated.

Once the target center is found, the function converts the pixel coordinate to the photo coordinates and stores them to the output result. Therefore, the photo must have its IO done before calling this function.

Noobeed generates from the calling Photo an edge image in TIF format , and names the edge file as "argm3_edge.tif".  Also Noobeed will generate a file named "argm3_plot.tif", which is an image of a plot of all finding target center points together with their two intersecting lines. Also, Noobeed will generate a file named "argm3_imgplot.tif", which is the "argm3_plot" superimposed on the original image.

 

Class

Photo

Usage

{VidPt2D} ret  =  object.CALIBXPYP({VecIdIndx} argm1, {VecIdPt2D} argm2, [{String} argm3])

argm1 = approximation of target point pixel coordinates Zat least 5 points)

argm2 = ground coordinates of target points

argm3 = filename to store output files

Example:

->a = Photo()
->a.loadtif(filename)
->a.camera() = cam
->a.IO()
->v_xpyp = a.calibxpyp(V1, V2, filename)
 

See also (class function)

-

| HOME | BACK |


CAMERA

| HOME | BACK |

Purpose

To return a Camera object of the current camera of the photo.

Class

Photo

Usage

{Camera} ret  =  object.CAMERA()

Example:

->cam = ph1.camera()

->

See also (class function)

image, io_para12, io_para21, eo_para

| HOME | BACK |


CLOSE

| HOME | BACK |

Purpose

To close a virtually loaded photo.  This function is irrelevant to a normal Image.

Class

Photo

Usage

{void} object.CLOSE()

Example:

->A = Photo()

->A.vload("ph_1")

->A.close()

See also (class function)

vload, load, save

| HOME | BACK |


COR_EARTH

| HOME | BACK |

Purpose

To compute earth curvature correction at a given x y photo coordinate.  The formula is an approximate one, as follows.

dr    =   r * r * r * numscale / ( 2 * earth_radius * camera_focal * SF_1000)

where  dr           = earth curvature correction

       r            = radial distance from principal point (e.g. 100.05 mm)

       numscale     = scale number of photo (e.g. 15000)

       earth_radius = 6370000 m

       camera_focal = camera focal length (e.g. 150 mm)

       SF_1000      = 1000  (unit scale factor to convert from meter to millimeter)

Class

Photo

Usage

{Pt2D} ret  =  object.COR_EARTH({double} argm1,{double} argm2)

argm1 = x photo coordinate

argm2 = y photo coordinate

Example:

->print ph1.cor_earth(100,100)

           ( 0.010 , 0.010)

->

See also (class function)

cor_rdd, cor_refract

| HOME | BACK |


COR_RDD

| HOME | BACK |

Purpose

To compute a correction of lens radial distortion at a given x y photo coordinate.  The correction is interpolated linearly from the lens distortion table of the current camera of the photo.

Class

Photo

Usage

{Pt2D} ret  =  object.COR_EARTH({double} argm1,{double} argm2)

argm1 = x photo coordinate

argm2 = y photo coordinate

Example:

->print ph1.cor_rdd(100,100)

           ( 0.000 , 0.000)

->

See also (class function)

cor_earth, cor_refract

| HOME | BACK |


COR_REFRACT

| HOME | BACK |

Purpose

To compute atmospheric refraction correction at a given x y photo coordinate.  The formula is adopted from "Manual of Photogrammetry" , as follows.

dr    =   - K * ( r + r * r * r / ( camera_focal * camera_focal))

where  dr           = atmospheric refraction correction

       r            = radial distance from principal point (e.g. 100.05 mm)

       camera_focal = camera focal length (e.g. 150 mm)

       K            = atmostpheric correction constant (is a function of elevation)

Class

Photo

Usage

{Pt2D} ret  =  object.COR_REFRACT({double} argm1,{double} argm2,{double} argm3)

argm1 = x photo coordinate

argm2 = y photo coordinate

argm3 = mean ground elevation (in meter)

Example:

->print ph1.cor_refract(100,100, 20)

           ( -0.003 , -0.003)

->

See also (class function)

cor_rdd, cor_earth

| HOME | BACK |


DRWCIRCLE

| HOME | BACK |

Purpose

To draw a circle in a Photo.

Class

Photo

Usage

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

argm1 = x photo coordinate of the center of the circle being drawn

argm2 = y photo coordinate of the center of the circle being drawn

argm3 = radius of the circle (in x y photo coordinate system unit)

Example:

->ph1.drwcircle(10,10,3)       

->

See also (class function)

drwline, drwpline

| HOME | BACK |


DRWLINE

| HOME | BACK |

Purpose

To draw an line in a PHoto.

Class

Photo

Usage

{void} object.DRWLINE({double} argm1, {double} argm2, {double} argm3, {double} argm4)

argm1 = x photo coordinate of the first point

argm2 = y photo coordinate of the first point

argm3 = x photo coordinate of the second point

argm4 = y photo coordinate of the second point

Example:

->ph1.drwline(100,100,3,2)       

->

See also (class function)

drwcircle, drwpline

| HOME | BACK |


DRWPLINE

| HOME | BACK |

Purpose

To draw a poly-line in a Photo.

Class

Photo

Usage

{void} object.DRWPLINE({VecPt2D} argm1)

argm1 = list of x y photo coordinates of a poly-line, stored in a VecPt2D object

Example:

->A.drwpline(pline1)       

->

See also (class function)

drwcircle, drwline

| HOME | BACK |


DRWTEXT

| HOME | BACK |

Purpose

To draw a text (number only) in a Photo.

Class

Photo

Usage

{void} object.DRWCIRCLE({double} argm1, {double} argm2, {String} argm argm3, {double} argm3)

argm1 = x photo coordinate of the center of the circle being drawn

argm2 = y photo coordinate of the center of the circle being drawn

argm3 = a text string (number only)

argm4 = height of the text (in x y photo coordinate system unit)

Example:

->ph1.drwctext(10,10,"123", 3)       

->

See also (class function)

drwline, drwpline

| HOME | BACK |


DRWVECCIRCLE

| HOME | BACK |

Purpose

To draw a list of circles in a Photo.

Class

Photo

Usage

{void} object.DRWCIRCLE({VecPt2D} argm1, {double} argm2)

argm1 = list x y photo coordinates of centers of circles

argm2 = radius of the circles (in x y photo coordinate system unit)

 

Example:

->ph1.drwveccircle(vec_center,3)       

->

See also (class function)

drwcircle, drwpline, drwline

| HOME | BACK |


DRWVECCIRCLE

| HOME | BACK |

Purpose

To draw a list of circles in a Photo.

Class

Photo

Usage

{void} object.DRWVECCIRCLE({VecPt2D} argm1, {double} argm2)

argm1 = list x y photo coordinates of centers of circles

argm2 = radius of circle in x y photo coordinate system unit

 

Example:

->ph1.drwveccircle(vec_center,3)       

->

See also (class function)

drwcircle, drwpline, drwline

| HOME | BACK |


DRWVECTEXT

| HOME | BACK |

Purpose

To draw a list of text string in a Photo.

Class

Photo

Usage

{void} object.DRWVECTEXT({VecPt2D} argm1, {VecStr} argm2, {double} argm3)

argm1 = list x y photo coordinates of centers of circles

argm2 = list of texts stored in a VecSTr object

argm3 = height of text (number only) in x y photo coordinate system unit

 

Example:

->ph1.drwvectext(vec_point, vec_text,3)       

->

See also (class function)

drwcircle, drwpline, drwline

| HOME | BACK |