image_points_to_world_planeT_image_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane (Operator)

Name

image_points_to_world_planeT_image_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane — Transform image points into the plane z=0 of a world coordinate system.

Signature

image_points_to_world_plane( : : CameraParam, WorldPose, Rows, Cols, Scale : X, Y)

Herror T_image_points_to_world_plane(const Htuple CameraParam, const Htuple WorldPose, const Htuple Rows, const Htuple Cols, const Htuple Scale, Htuple* X, Htuple* Y)

void ImagePointsToWorldPlane(const HTuple& CameraParam, const HTuple& WorldPose, const HTuple& Rows, const HTuple& Cols, const HTuple& Scale, HTuple* X, HTuple* Y)

void HCamPar::ImagePointsToWorldPlane(const HPose& WorldPose, const HTuple& Rows, const HTuple& Cols, const HTuple& Scale, HTuple* X, HTuple* Y) const

void HCamPar::ImagePointsToWorldPlane(const HPose& WorldPose, const HTuple& Rows, const HTuple& Cols, const HString& Scale, HTuple* X, HTuple* Y) const

void HCamPar::ImagePointsToWorldPlane(const HPose& WorldPose, const HTuple& Rows, const HTuple& Cols, const char* Scale, HTuple* X, HTuple* Y) const

void HCamPar::ImagePointsToWorldPlane(const HPose& WorldPose, const HTuple& Rows, const HTuple& Cols, const wchar_t* Scale, HTuple* X, HTuple* Y) const   (Windows only)

static void HOperatorSet.ImagePointsToWorldPlane(HTuple cameraParam, HTuple worldPose, HTuple rows, HTuple cols, HTuple scale, out HTuple x, out HTuple y)

void HCamPar.ImagePointsToWorldPlane(HPose worldPose, HTuple rows, HTuple cols, HTuple scale, out HTuple x, out HTuple y)

void HCamPar.ImagePointsToWorldPlane(HPose worldPose, HTuple rows, HTuple cols, string scale, out HTuple x, out HTuple y)

Description

The operator image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlaneImagePointsToWorldPlane transforms image points which are given in RowsRowsRowsRowsrows and ColsColsColsColscols into the plane z=0 in a world coordinate system and returns their 3D coordinates in XXXXx and YYYYy. The world coordinate system is chosen by passing its pose relative to the camera coordinate system in WorldPoseWorldPoseWorldPoseWorldPoseworldPose. Hence, latter one is expected in the form , where ccs denotes the camera coordinate system and wcs the world coordinate system (see Transformations / Poses and “Solution Guide III-C - 3D Vision”). In CameraParamCameraParamCameraParamCameraParamcameraParam you must pass the internal camera parameters (see Calibration for the sequence of the parameters and the underlying camera model).

In many cases CameraParamCameraParamCameraParamCameraParamcameraParam and WorldPoseWorldPoseWorldPoseWorldPoseworldPose are the result of calibrating the camera with the operator calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerasCalibrateCameras. See below for an example.

With the parameter ScaleScaleScaleScalescale you can scale the resulting 3D coordinates. The parameter ScaleScaleScaleScalescale must be specified as the ratio desired unit/original unit. The original unit is determined by the coordinates of the calibration object. If the original unit is meters (which is the case if you use the standard calibration plate), you can set the desired unit directly by selecting 'm'"m""m""m""m", 'cm'"cm""cm""cm""cm", 'mm'"mm""mm""mm""mm" or 'um'"um""um""um""um" for the parameter ScaleScaleScaleScalescale.

Internally, the operator first computes the line of sight between the projection center and the image contour points in the camera coordinate system, taking into account the radial distortions. The line of sight is then transformed into the world coordinate system specified in WorldPoseWorldPoseWorldPoseWorldPoseworldPose. By intersecting the plane z=0 with the line of sight the 3D coordinates XXXXx and YYYYy are obtained.

It is recommended to use only those image points RowsRowsRowsRowsrows and ColsColsColsColscols, that lie within the calibrated image size. The mathematical model does only work well for image points, that lie within the calibration range.

Execution Information

Parameters

CameraParamCameraParamCameraParamCameraParamcameraParam (input_control)  campar HCamPar, HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Internal camera parameters.

WorldPoseWorldPoseWorldPoseWorldPoseworldPose (input_control)  pose HPose, HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

3D pose of the world coordinate system in camera coordinates.

Number of elements: 7

RowsRowsRowsRowsrows (input_control)  coordinates.y-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinates of the points to be transformed.

Default value: 100.0

ColsColsColsColscols (input_control)  coordinates.x-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column coordinates of the points to be transformed.

Default value: 100.0

ScaleScaleScaleScalescale (input_control)  number HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Scale or dimension

Default value: 'm' "m" "m" "m" "m"

Suggested values: 'm'"m""m""m""m", 'cm'"cm""cm""cm""cm", 'mm'"mm""mm""mm""mm", 'microns'"microns""microns""microns""microns", 'um'"um""um""um""um", 1.0, 0.01, 0.001, 1.0e-6, 0.0254, 0.3048, 0.9144

Restriction: Scale > 0

XXXXx (output_control)  coordinates.x-array HTupleHTupleHtuple (real) (double) (double) (double)

X coordinates of the points in the world coordinate system.

YYYYy (output_control)  coordinates.y-array HTupleHTupleHtuple (real) (double) (double) (double)

Y coordinates of the points in the world coordinate system.

Example (HDevelop)

*  Perform camera calibration (with standard calibration plate).
calibrate_cameras (CalibDataID, Error)
get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam)
* Get reference pose (pose 2 of calibration object 0).
get_calib_data (CalibDataID, 'calib_obj_pose',\
                [0,2], 'pose', WorldPose)
*  Compensate thickness of plate.
set_origin_pose(ObjInCameraPose, 0, 0, 0.0006, WorldPose)
*  Transform image points into world coordinate system (unit mm).
image_points_to_world_plane(CamParam, WorldPose, PointRows, PointColumns, \
                            'mm', PointXCoord, PointYCoord)

Result

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

Possible Predecessors

create_posecreate_poseCreatePoseCreatePoseCreatePose, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibration, hand_eye_calibrationhand_eye_calibrationHandEyeCalibrationHandEyeCalibrationHandEyeCalibration, set_origin_poseset_origin_poseSetOriginPoseSetOriginPoseSetOriginPose

See also

contour_to_world_plane_xldcontour_to_world_plane_xldContourToWorldPlaneXldContourToWorldPlaneXldContourToWorldPlaneXld, project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPoint

Module

Calibration