ClassesClassesClassesClasses | | | | Operators

get_line_of_sightT_get_line_of_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight (Operator)

Name

get_line_of_sightT_get_line_of_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight — 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)

Herror 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)

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

void HOperatorSetX.GetLineOfSight(
[in] VARIANT Row, [in] VARIANT Column, [in] VARIANT CameraParam, [out] VARIANT* PX, [out] VARIANT* PY, [out] VARIANT* PZ, [out] VARIANT* QX, [out] VARIANT* QY, [out] VARIANT* QZ)

VARIANT HMiscX.GetLineOfSight(
[in] VARIANT Row, [in] VARIANT Column, [in] VARIANT CameraParam, [out] VARIANT* PY, [out] VARIANT* PZ, [out] VARIANT* QX, [out] VARIANT* QY, [out] VARIANT* QZ)

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)

static void HMisc.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)

Description

get_line_of_sightget_line_of_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight 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 CameraParamCameraParamCameraParamCameraParamCameraParamcameraParam (see calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras 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_3dAffineTransPoint3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d to the two points.

Parallelization

Parameters

RowRowRowRowRowrow (input_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the pixel.

ColumnColumnColumnColumnColumncolumn (input_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the pixel.

CameraParamCameraParamCameraParamCameraParamCameraParamcameraParam (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Internal camera parameters.

Number of elements: CameraParam == 8 || CameraParam == 10 || CameraParam == 11 || CameraParam == 12 || CameraParam == 14

PXPXPXPXPXPX (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

PYPYPYPYPYPY (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

PZPZPZPZPZPZ (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

QXQXQXQXQXQX (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

QYQYQYQYQYQY (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

QZQZQZQZQZQZ (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

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

Example (HDevelop)

*  get internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  inverse projection
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (HDevelop)

*  get internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  inverse projection
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (HDevelop)

*  get internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  inverse projection
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (C++ (HALCON 5.0-10.0))

HTuple CameraParam, Row, Column, PX, PY, PZ, QX, QY, QZ;
// get internal camera parameters
read_cam_par("campar.dat", &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)

*  get internal camera parameters
read_cam_par('campar.dat', CameraParam)
*  inverse projection
get_line_of_sight([50, 100], [100, 200], CameraParam, PX, PY, PZ, QX, QY, QZ)

Example (HDevelop)

*  get internal camera parameters
read_cam_par('campar.dat', 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_sightGetLineOfSightget_line_of_sightGetLineOfSightGetLineOfSight returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.

Possible Predecessors

read_cam_parread_cam_parReadCamParread_cam_parReadCamParReadCamPar, camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration

Possible Successors

affine_trans_point_3daffine_trans_point_3dAffineTransPoint3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

See also

camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, disp_caltabdisp_caltabDispCaltabdisp_caltabDispCaltabDispCaltab, read_cam_parread_cam_parReadCamParread_cam_parReadCamParReadCamPar, project_3d_pointproject_3d_pointProject3dPointproject_3d_pointProject3dPointProject3dPoint, affine_trans_point_3daffine_trans_point_3dAffineTransPoint3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

Module

Calibration


ClassesClassesClassesClasses | | | | Operators