HALCON Reference Manual 10.0.2
Table of Contents / Calibration / Projection ClassesClassesClasses | | | Operators

project_3d_pointT_project_3d_pointproject_3d_pointProject3dPointProject3dPoint (Operator)

Name

project_3d_pointT_project_3d_pointproject_3d_pointProject3dPointProject3dPoint — Project 3D points into (sub-)pixel image coordinates.

Signature

project_3d_point( : : X, Y, Z, CameraParam : Row, Column)

Herror T_project_3d_point(const Htuple X, const Htuple Y, const Htuple Z, const Htuple CameraParam, Htuple* Row, Htuple* Column)

Herror project_3d_point(const HTuple& X, const HTuple& Y, const HTuple& Z, const HTuple& CameraParam, HTuple* Row, HTuple* Column)

void HOperatorSetX.Project3dPoint(
[in] VARIANT X, [in] VARIANT Y, [in] VARIANT Z, [in] VARIANT CameraParam, [out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HMiscX.Project3dPoint(
[in] VARIANT X, [in] VARIANT Y, [in] VARIANT Z, [in] VARIANT CameraParam, [out] VARIANT* Column)

static void HOperatorSet.Project3dPoint(HTuple x, HTuple y, HTuple z, HTuple cameraParam, out HTuple row, out HTuple column)

static void HMisc.Project3dPoint(HTuple x, HTuple y, HTuple z, HTuple cameraParam, out HTuple row, out HTuple column)

Description

project_3d_pointproject_3d_pointproject_3d_pointProject3dPointProject3dPoint projects one or more 3D points (with coordinates XXXXx, YYYYy, and ZZZZz) into the image plane (in pixels) and returns the result in RowRowRowRowrow and ColumnColumnColumnColumncolumn. The coordinates XXXXx, YYYYy, and ZZZZz are given in the camera coordinate system, i.e., they describe the position of the points relative to the camera.

The internal camera parameters CameraParamCameraParamCameraParamCameraParamcameraParam describe the projection characteristics of the camera (see write_cam_parwrite_cam_parwrite_cam_parWriteCamParWriteCamPar).

Parallelization

Parameters

XXXXx (input_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

X coordinates of the 3D points to be projected in the camera coordinate system.

YYYYy (input_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Y coordinates of the 3D points to be projected in the camera coordinate system.

ZZZZz (input_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Z coordinates of the 3D points to be projected in the camera coordinate system.

CameraParamCameraParamCameraParamCameraParamcameraParam (input_control)  number-array HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Internal camera parameters.

Number of elements: ((CameraParam == 8) || (CameraParam == 11)) || (CameraParam == 12)

RowRowRowRowrow (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row coordinates of the projected points (in pixels).

ColumnColumnColumnColumncolumn (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Column coordinates of the projected points (in pixels).

Example (HDevelop)

*  read pose of the world coordinate system in camera coordinates
read_pose('worldpose.dat', WorldPose)
*  convert pose into transformation matrix
pose_to_hom_mat3d(WorldPose, HomMat3D)
*  transform 3D points from world into the camera coordinate system
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [5.8, 6.2], X, Y, Z)
*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
* project 3D points into image
project_3d_point(X, Y, Z, CameraParam, Row, Column)

Example (HDevelop)

*  read pose of the world coordinate system in camera coordinates
read_pose('worldpose.dat', WorldPose)
*  convert pose into transformation matrix
pose_to_hom_mat3d(WorldPose, HomMat3D)
*  transform 3D points from world into the camera coordinate system
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [5.8, 6.2], X, Y, Z)
*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
* project 3D points into image
project_3d_point(X, Y, Z, CameraParam, Row, Column)

Example (C++)

HTuple WorldPose, HomMat3D, X1, Y1, Z1, X2, Y2, Z2;
HTuple CameraParam, Row, Column;
//  read pose of the world coordinate system in camera coordinates
read_pose("worldpose.dat", &WorldPose);
//  convert pose into transformation matrix
pose_to_hom_mat3d(WorldPose, &HomMat3D);
//  transform 3D points from source into destination coordinate system
X1[1] = 3.2;
X1[0] = 3.0;
Y1[1] = 4.5;
Y1[0] = 4.5;
Z1[1] = 6.2;
Z1[0] = 5.8;
affine_trans_point_3d(HomMat3D, X1, Y1, Z1, &X2, &Y2, &Z2);
// read internal camera parameters
read_cam_par("campar.dat", &CameraParam);
// project 3D points into image
project_3d_point(X2, Y2, Z2, CameraParam, &Row, &Column);

Example (HDevelop)

*  read pose of the world coordinate system in camera coordinates
read_pose('worldpose.dat', WorldPose)
*  convert pose into transformation matrix
pose_to_hom_mat3d(WorldPose, HomMat3D)
*  transform 3D points from world into the camera coordinate system
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [5.8, 6.2], X, Y, Z)
*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
* project 3D points into image
project_3d_point(X, Y, Z, CameraParam, Row, Column)

Example (HDevelop)

*  read pose of the world coordinate system in camera coordinates
read_pose('worldpose.dat', WorldPose)
*  convert pose into transformation matrix
pose_to_hom_mat3d(WorldPose, HomMat3D)
*  transform 3D points from world into the camera coordinate system
affine_trans_point_3d(HomMat3D, [3.0, 3.2], [4.5, 4.5], [5.8, 6.2], X, Y, Z)
*  read internal camera parameters
read_cam_par('campar.dat', CameraParam)
* project 3D points into image
project_3d_point(X, Y, Z, CameraParam, Row, Column)

Result

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

Possible Predecessors

read_cam_parread_cam_parread_cam_parReadCamParReadCamPar, affine_trans_point_3daffine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

Possible Successors

gen_region_pointsgen_region_pointsgen_region_pointsGenRegionPointsGenRegionPoints, gen_region_polygongen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygon, disp_polygondisp_polygondisp_polygonDispPolygonDispPolygon

See also

camera_calibrationcamera_calibrationcamera_calibrationCameraCalibrationCameraCalibration, disp_caltabdisp_caltabdisp_caltabDispCaltabDispCaltab, read_cam_parread_cam_parread_cam_parReadCamParReadCamPar, get_line_of_sightget_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSight, affine_trans_point_3daffine_trans_point_3daffine_trans_point_3dAffineTransPoint3dAffineTransPoint3d

Module

Calibration


Table of Contents / Calibration / Projection ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH