get_line_of_sight ( : : Row, Column, CamParam : PX, PY, PZ, QX, QY, QZ )

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.


Parameters

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


Example
*  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)

Result

get_line_of_sight returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception handling is raised.


Parallelization Information

get_line_of_sight is reentrant and processed without parallelization.


Possible Predecessors

read_cam_par, camera_calibration


Possible Successors

affine_trans_point_3d


See also

camera_calibration, disp_caltab, read_cam_par, project_3d_point, affine_trans_point_3d


Module

Camera calibration



Copyright © 1996-2005 MVTec Software GmbH