|
Photo Class Function Manual (I-L) |
Purpose
To report an ID of a Photo.
Class
Photo
Usage
{int} ret = object.ID()
Example:
|
->id = ph1.id() -> |
See also (class function)
Purpose
To return an Image object of a Photo.
Class
Photo
Usage
{Image_uch} ret = object.IMAGE()
Example:
|
->Img = ph1.image() -> |
See also (class function)
Purpose
To initialize a Photo object.
Class
Photo
Usage
{void} object.INIT({int} argm1, {int} argm2)
argm1 = no of rows
argm2 = no of columns
Example:
|
->ph1.init(1000,2000) -> |
See also (class function)
Purpose
To perform Interior Orientation (IO) using 2D transformation.
Three type of transformations available are conformal (4 parameters), affine (6 parameters), and 2nd polynomial (12 parameters).
This function uses coordinates of fiducial marks of the camera as a sort of control points. The input measure coordinates of fiducial marks on the photograph can be either row and column numbers or x y image rectangular coordinates. See details in Understanding Coordinate System.
The results Interior Orientation Parameters (IOP) are used to updated io-para12 and io_para21, which are parameters used to transform between x y image rectangular coordinate and x y photo coordinates back and forth.
Moreover, an ASCII text file is automatically generated after the IO is done. Also a matrix containing IOP and all related information is return to the user. This matrix is actually where the information in the report is from. By comparing the returning matrix to the report, the user can easily figure out what output information is represented by which part of the matrix.
The computation of this function does not involve image data, therefore, it is possible to load the photo in virtual mode, using function "vload". This can reduce computer time tremendously, especially when the size of the photo is very large.
| Important remark 1. Always try to scan each individual photo is such a way that the direction of FLIGHT LINE points from the left to the right.
|
Class
Photo
Usage
{Matrix} ret = object.IO([{VecIdPt2D} argm1, {String} argm2, {String} argm3, {int} argm4])
argm1 = list of measuring fiducial coordinates on photo
(default will be 4 corner point coordinate in x y image system)
argm2 = type of transformation, must be either "conformal", or "affine", or "poly2nd"
(default = "conformal")
argm3 = output file name for the report (default = "RPT_IO.txt")
argm4 = type of measuring coordinates on the photo,
must be 0(row and column) or 1(image rectangular coordinate).
(default = 0 (row and column number))
Example:
|
->M_tmp = ph1.IO(vec_meas_fid, "affine", "ph_193_io.txt", 0) -> |
See also (class function)
EO
Purpose
To perform Interior Orientation for a digital camera. In fact this function does nothing, but read camera information (c, xp, yp) and distortion parameters (k1, k2, A1, A2, p1, p2) and store them as interior orientation parameters.
The full extended collinearity is used in a digital camera as follows.
x = xp - c Nx/D + dx
y = xp - c Ny/D + dy
where dx and dy is photo coordinate perturbations
dx = dx(radial) + dx(affine) + dx(decentric)
dy = dy(radial) + dy(affine) + dy(decentric)
dx(radial) = (k1)(r^2)x + (k)2(r^4)x
dy(radial) = (k1)(r^2)y + (k)2(r^4)y
where r^2 = (x-xp)^2 + (y-yp)^2
dx(affine) = -(A1)x + (A2)y
dy(affine) = (A1)y
dx(decentric) = (p1)(r^2 + 2x^2) + 2(p2)xy
dy(decentric) = 2(p1)xy + (p2)(r^2 + 2y^2)
where r^2 = (x-xp)^2 + (y-yp)^2
A digital camera must have all of its fiducial marks ID less than 0, zero, and their fiducial coordinates are interpreted as distortion parameters, using the following rule:
x y coordinate of the 1st given fiducial mark is pixel size in x and pixel size in y direction
x y coordinate of the 2ndgiven fiducial mark is k1 and k2
x y coordinate of the 3rd given fiducial mark is A1 and A2
x y coordinate of the 4th given fiducial mark is p1 and p2
If more than 4 fiducial marks is given, only the first three points are relevant.
The following is an example of a digital camera documentation file.
|
It is seen that this is exactly the same as an ordinary camera documentation file, with an exception that its fiducial mark coordinates are actually geometric distortion parameters. The above example, we have pixel size in x direction = 0.004 and pixel size in y direction = 0.004. The rest of parameters, namely k1, k2, A1, A2, p1 and p2, are all zeros.
This function will reset the two corners of the Photo x and y image rectangular coordinate, lower left and upper right, as follows.
Suppose the original photo has 100 rows and 200 columns, its initial coordinate of the two corners will be:
lower left x = 0 y = 0 and upper right x = 200 y = 100.
Once this photo calls this function,
the lower left coordinate will be x = -(200*0.004)/2 ; y = -(100*0.004)/2
the upper right coordinate will be x = (200*0.004)/2 ; y = (100*0.004)/2
Then the function will read distortion parameters, and store them in the vector of IOP in the following order k1, A1, p1, k2, A2, p2, and followed by an additional value of zero. Thus there must be exactly 7 values in the vector of IOP, io_para12, in order that the photo is regarded as digital camera image. The number of elements, 7, is the only way that Noobeed can recognize a digital camera image.
Please compare this strategy to the traditional aerail photo, where the number of parameters in vector of IOP, io_para12, is used to indicate the type of transformation, i.e. 4 = conformal, 6 = affine, and 12 = polynomial 2nd degree.
Once this function is done, relationship between x y image rectangular coordinate and xp yp photo coordinate is established.
Class
Photo
Usage
{void} ret = object.IO_DIGITALCAM()
Example:
|
->ph1.camera() = cam_digital ->ph1.IO_digitalcam() -> |
See also (class function)
IO
Purpose
To report the current Interior Orientation Parameters of the photo. Loosely speaking, this is a parameter set that used to transform from x y image rectangular coordinate to x y photo coordinate. The number of parameters indicates the type of transformation, as follows.
| Conformal (4 parameters) |
xp = ax + by + Cx yp = -bx + ay + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = Cx eo_para12(3) = Cy |
| Affine (6 parameters) |
xp = ax + by + Cx yp = cx + dy + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = c eo_para12(3) = d eo_para12(4) = Cx eo_para12(5) = Cy |
| 2nd polynomial (10 parameters) |
xp = ax + by +
cx2 + dy2 + exy + Cx yp = aax + bby + ccx2 + ddy2 + eexy + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = c eo_para12(3) = d eo_para12(4) = e eo_para12(5) = aa eo_para12(6) = bb eo_para12(7) = cc eo_para12(8) = dd eo_para12(9) = ee eo_para12(10) = Cx eo_para12(11) = Cy |
Class
Photo
Usage
{Vector} ret = object.IO_PARA12()
Example:
|
->vec_para = ph1.io_para12() -> |
See also (class function)
io_para21
Purpose
To report the current Interior Orientation Parameters of the photo. Loosely speaking, this is a parameter set that used to transform from xp yp photo coordinate to x y image rectangular coordinate. The number of parameters indicates the type of transformation, as follows.
| Conformal (4 parameters) |
x = axp + byp + Cx y = -bxp + ayp + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = Cx eo_para12(3) = Cy |
| Affine (6 parameters) |
x = axp + byp + Cx y = cxp + dyp + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = c eo_para12(3) = d eo_para12(4) = Cx eo_para12(5) = Cy |
| 2nd polynomial (10 parameters) |
x = axp + byp
+ cxp2 + dyp2 + exyp + Cx y = aaxp + bbyp + ccxp2 + ddyp2 + eexyp + Cy |
eo_para12(0) = a eo_para12(1) = b eo_para12(2) = c eo_para12(3) = d eo_para12(4) = e eo_para12(5) = aa eo_para12(6) = bb eo_para12(7) = cc eo_para12(8) = dd eo_para12(9) = ee eo_para12(10) = Cx eo_para12(11) = Cy |
Class
Photo
Usage
{Vector} ret = object.IO_PARA21()
Example:
|
->vec_para = ph1.io_para21() -> |
See also (class function)
io_para12
Purpose
To determine whether a point is covered by a Photo.
Class
Photo
Usage
{bool} ret = object.IS_COVER({double} argm1, {double} argm2)
argm1 = x photo coordinate of a point being determined
argm2 = y photo coordinate of a point being determined
Example:
|
->b1 = ph1.is_cover(15.012, 100.235)
-> |
See also (class function)
Purpose
To load a Photo 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 image.
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
Photo
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")
Example:
|
->A = Photo() ->A.load("my_photo") -> |
See also (class function)
loadtif, loadbmp
Purpose
To load data from a bitmap (BMP) file and stored in a Photo 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 8-bit and with no compression.
Class
Photo
Usage
{void} object.LOADBMP({String} argm1)
argm1 = file name for the bitmap file (default extension is ".bmp")
Example:
|
->A = Photo() ->A.loadbmp("my_bmp") -> |
See also (class function)
loadtif, load
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 8-bit gray scale image and with no compression.
Class
Photo
Usage
{void} object.LOADTIF({String} argm1)
argm1 = file name for the TIF file (default extension is ".tif")
Example:
|
->A = Photo() ->A.loadtif("my_tif") -> |
See also (class function)
load, loadbmp
Purpose
To report x y photo coordinate of the lower left corner of the photo.
Class
Photo
Usage
{Pt2D} ret = object.LOWER_LEFT()
Example:
|
->pt1 = ph1.lower_left() -> |
See also (class function)
upper_right, res_x, res_y
Purpose
To report x y photo coordinate of the lower right corner of the photo.
Class
Photo
Usage
{Pt2D} ret = object.LOWER_RIGHT()
Example:
|
->pt1 = ph1.lower_right() -> |
See also (class function)
upper_right, res_x, res_y