Compute the line of sight corresponding to a point in the image.
get_line_of_sight computes the line of sight corresponding to a pixel (Row, Column) in the image. The line of sight is a (straight) line in the camera coordinate system, which is described by two points (PX,PY,PZ) and (QX,QY,QZ) on the line. A pinhole or telecentric camera model with radial distortions described by the interior camera parameters CamParam is used (see write_cam_par). If a pinhole camera is used, the second point lies on the focal plane, i.e., the output parameter QZ is equivalent to the focal length of the camera. The equation of the line of sight is given by
/ X \ / PX \ / QX - PX \ | Y | = | PY | + l * | QY - PY | \ Z / \ PZ / \ QZ - PZ /
The advantage of representing the line of sight as two points is that it is easier to transform the line in 3D. To do so, all that is necessary is to apply the operator affine_trans_point_3d to the two points.
|
Row (input_control) |
real-array -> real |
| Row coordinate of the pixel. | |
|
Column (input_control) |
real-array -> real |
| Column coordinate of the pixel. | |
|
CamParam (input_control) |
number-array -> real / integer |
| Interior camera parameters. | |
| Number of elements: 8 | |
|
PX (output_control) |
real-array -> real |
| X coordinate of the first point on the line of sight in the camera coordinate system | |
|
PY (output_control) |
real-array -> real |
| Y coordinate of the first point on the line of sight in the camera coordinate system | |
|
PZ (output_control) |
real-array -> real |
| Z coordinate of the first point on the line of sight in the camera coordinate system | |
|
QX (output_control) |
real-array -> real |
| X coordinate of the second point on the line of sight in the camera coordinate system | |
|
QY (output_control) |
real-array -> real |
| Y coordinate of the second point on the line of sight in the camera coordinate system | |
|
QZ (output_control) |
real-array -> real |
| Z coordinate of the second point on the line of sight in the camera coordinate system | |
* get interior camera parameters
read_cam_par('campar.dat', CamParam)
* inverse projection
get_line_of_sight([50, 100], [100, 200], CamParam, PX, PY, PZ, QX, QY, QZ)get_line_of_sight returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception handling is raised.
get_line_of_sight is reentrant and processed without parallelization.
read_cam_par, camera_calibration
camera_calibration, disp_caltab, read_cam_par, project_3d_point, affine_trans_point_3d
Camera calibration