get_line_of_sightT_get_line_of_sightGetLineOfSightGetLineOfSightget_line_of_sight (Operator)

Name

get_line_of_sightT_get_line_of_sightGetLineOfSightGetLineOfSightget_line_of_sight — Compute the line of sight corresponding to a point in the image.

Signature

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

Herror T_get_line_of_sight(const Htuple Row, const Htuple Column, const Htuple CameraParam, Htuple* PX, Htuple* PY, Htuple* PZ, Htuple* QX, Htuple* QY, Htuple* QZ)

void GetLineOfSight(const HTuple& Row, const HTuple& Column, const HTuple& CameraParam, HTuple* PX, HTuple* PY, HTuple* PZ, HTuple* QX, HTuple* QY, HTuple* QZ)

void HCamPar::GetLineOfSight(const HTuple& Row, const HTuple& Column, HTuple* PX, HTuple* PY, HTuple* PZ, HTuple* QX, HTuple* QY, HTuple* QZ) const

static void HOperatorSet.GetLineOfSight(HTuple row, HTuple column, HTuple cameraParam, out HTuple PX, out HTuple PY, out HTuple PZ, out HTuple QX, out HTuple QY, out HTuple QZ)

void HCamPar.GetLineOfSight(HTuple row, HTuple column, out HTuple PX, out HTuple PY, out HTuple PZ, out HTuple QX, out HTuple QY, out HTuple QZ)

def get_line_of_sight(row: Sequence[float], column: Sequence[float], camera_param: Sequence[Union[int, float, str]]) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

Description

get_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSightGetLineOfSightget_line_of_sight computes the line of sight corresponding to a pixel (RowRowRowRowrowrow, ColumnColumnColumnColumncolumncolumn) in the image. The line of sight is a (straight) line in the camera coordinate system, which is described by two points (PXPXPXPXPXpx,PYPYPYPYPYpy,PZPZPZPZPZpz) and (QXQXQXQXQXqx,QYQYQYQYQYqy,QZQZQZQZQZqz) on the line. The camera is described by the internal camera parameters CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param (see Calibration for details). If a pinhole camera is used, the second point lies on the focal plane, i.e., for frame cameras, the output parameter QZQZQZQZQZqz is equivalent to the focal length of the camera, whereas for linescan cameras, QZQZQZQZQZqz also depends on the motion of the camera with respect to the object. The equation of the line of sight is given by

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_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3dAffineTransPoint3daffine_trans_point_3d to the two points.

Execution Information

Parameters

RowRowRowRowrowrow (input_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of the pixel.

ColumnColumnColumnColumncolumncolumn (input_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of the pixel.

CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param (input_control)  campar HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Internal camera parameters.

PXPXPXPXPXpx (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

X coordinate of the first point on the line of sight in the camera coordinate system

PYPYPYPYPYpy (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Y coordinate of the first point on the line of sight in the camera coordinate system

PZPZPZPZPZpz (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Z coordinate of the first point on the line of sight in the camera coordinate system

QXQXQXQXQXqx (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

X coordinate of the second point on the line of sight in the camera coordinate system

QYQYQYQYQYqy (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Y coordinate of the second point on the line of sight in the camera coordinate system

QZQZQZQZQZqz (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Z coordinate of the second point on the line of sight in the camera coordinate system

Example (HDevelop)

* Set internal camera parameters.
* Note the, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, 30, 4.65e-006, 4.65e-006, \
                                640, 480, 1280, 960, CameraParam)
* Inverse projection.
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (HDevelop)

* Set internal camera parameters.
* Note the, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, 30, 4.65e-006, 4.65e-006, \
                                640, 480, 1280, 960, CameraParam)
* Inverse projection.
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (C++)

HTuple CameraParam, Row, Column, PX, PY, PZ, QX, QY, QZ;
// Set internal camera parameters.
// Note the, typically, these values are the result of a prior
// calibration.
gen_cam_par_area_scan_division (0.01, 30, 4.65e-006, 4.65e-006,
                                640, 480, 1280, 960, &CameraParam);
// Inverse projection.
Row[1] = 100;
Row[0] = 50;
Column[1] = 200;
Column[0] = 100;
get_line_of_sight(Row, Column, CameraParam, &PX, &PY, &PZ, &QX, &QY, &QZ);

Example (HDevelop)

* Set internal camera parameters.
* Note the, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, 30, 4.65e-006, 4.65e-006, \
                                640, 480, 1280, 960, CameraParam)
* Inverse projection.
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (HDevelop)

* Set internal camera parameters.
* Note the, typically, these values are the result of a prior
* calibration.
gen_cam_par_area_scan_division (0.01, 30, 4.65e-006, 4.65e-006, \
                                640, 480, 1280, 960, CameraParam)
* Inverse projection.
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Result

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

Possible Predecessors

read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration

Possible Successors

affine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3dAffineTransPoint3daffine_trans_point_3d

See also

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab, read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par, project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point, affine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3dAffineTransPoint3daffine_trans_point_3d

Module

Calibration