HALCON Reference Manual 10.0.2
Name
image_points_to_world_planeT_image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane — Transform image points into the plane z=0 of a world coordinate system.
void HOperatorSetX.ImagePointsToWorldPlane(
[in] VARIANT CameraParam, [in] VARIANT WorldPose, [in] VARIANT Rows, [in] VARIANT Cols, [in] VARIANT Scale, [out] VARIANT* X, [out] VARIANT* Y)
VARIANT HMiscX.ImagePointsToWorldPlane(
[in] VARIANT CameraParam, [in] VARIANT WorldPose, [in] VARIANT Rows, [in] VARIANT Cols, [in] VARIANT Scale, [out] VARIANT* Y)
static void HOperatorSet.ImagePointsToWorldPlane(HTuple cameraParam, HTuple worldPose, HTuple rows, HTuple cols, HTuple scale, out HTuple x, out HTuple y)
static void HMisc.ImagePointsToWorldPlane(HTuple cameraParam, HPose worldPose, HTuple rows, HTuple cols, HTuple scale, out HTuple x, out HTuple y)
static void HMisc.ImagePointsToWorldPlane(HTuple cameraParam, HPose worldPose, HTuple rows, HTuple cols, string scale, out HTuple x, out HTuple y)
The operator image_points_to_world_planeimage_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane 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 3D pose
relative to the camera coordinate system in WorldPoseWorldPoseWorldPoseWorldPoseworldPose. In
CameraParamCameraParamCameraParamCameraParamcameraParam you must pass the internal camera parameters (see
write_cam_parwrite_cam_parwrite_cam_parWriteCamParWriteCamPar 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_camerascalibrate_camerasCalibrateCamerasCalibrateCameras. 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.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Internal camera parameters.
Number of elements: ((CameraParam == 8) || (CameraParam == 11)) || (CameraParam == 12)
3D pose of the world coordinate system in camera
coordinates.
Number of elements: 7
RowsRowsRowsRowsrows (input_control) coordinates.y-array → HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)
Row coordinates of the points to be transformed.
Default value: 100.0
ColsColsColsColscols (input_control) coordinates.x-array → HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)
Column coordinates of the points to be transformed.
Default value: 100.0
ScaleScaleScaleScalescale (input_control) number → HTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (char* / Hlong / double) (BSTR / 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
XXXXx (output_control) coordinates.x-array → HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)
X coordinates of the points in the world coordinate
system.
YYYYy (output_control) coordinates.y-array → HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)
Y coordinates of the points in the world coordinate
system.
* perform camera calibration (with standard calibration plate)
camera_calibration(NX, NY, NZ, NRow, NCol, StartCamParam, NStartPose, \
'all', FinalCamParam, NFinalPose, Errors)
* world coordinate system is defined by calibration plate in first image
FinalPose1 := NFinalPose[0:6]
* compensate thickness of plate
set_origin_pose(FinalPose1, 0, 0, 0.0006, WorldPose)
* transform image points into world coordinate system (unit mm)
image_points_to_world_plane(FinalCamParam, WorldPose, PointRows, PointCols, \
'mm', PointXCoord, PointYCoord)
* perform camera calibration (with standard calibration plate)
camera_calibration(NX, NY, NZ, NRow, NCol, StartCamParam, NStartPose, \
'all', FinalCamParam, NFinalPose, Errors)
* world coordinate system is defined by calibration plate in first image
FinalPose1 := NFinalPose[0:6]
* compensate thickness of plate
set_origin_pose(FinalPose1, 0, 0, 0.0006, WorldPose)
* transform image points into world coordinate system (unit mm)
image_points_to_world_plane(FinalCamParam, WorldPose, PointRows, PointCols, \
'mm', PointXCoord, PointYCoord)
HTuple NX, NY, NZ, NRow, NCol;
HTuple StartCamParam, NStartPose, FinalCamParam, NFinalPose, Errors;
HTuple FinalPose1, WorldPose;
HTuple PointRows, PointCols, PointXCoord, PointYCoord;
// perform camera calibration (with standard calibration plate)
camera_calibration(NX, NY, NZ, NRow, NCol, StartCamParam, NStartPose, "all",
&FinalCamParam, &NFinalPose, &Errors);
// world coordinate system is defined by calibration plate in first image
FinalPose1 = NFinalPose(0,6);
// compensate thickness of plate
set_origin_pose(FinalPose1, 0, 0, 0.0006, &WorldPose);
// transform image points into world coordinate system (unit mm)
image_points_to_world_plane(FinalCamParam, WorldPose, PointRows, PointCols,
"mm", &PointXCoord, &PointYCoord)
* perform camera calibration (with standard calibration plate)
camera_calibration(NX, NY, NZ, NRow, NCol, StartCamParam, NStartPose, \
'all', FinalCamParam, NFinalPose, Errors)
* world coordinate system is defined by calibration plate in first image
FinalPose1 := NFinalPose[0:6]
* compensate thickness of plate
set_origin_pose(FinalPose1, 0, 0, 0.0006, WorldPose)
* transform image points into world coordinate system (unit mm)
image_points_to_world_plane(FinalCamParam, WorldPose, PointRows, PointCols, \
'mm', PointXCoord, PointYCoord)
* perform camera calibration (with standard calibration plate)
camera_calibration(NX, NY, NZ, NRow, NCol, StartCamParam, NStartPose, \
'all', FinalCamParam, NFinalPose, Errors)
* world coordinate system is defined by calibration plate in first image
FinalPose1 := NFinalPose[0:6]
* compensate thickness of plate
set_origin_pose(FinalPose1, 0, 0, 0.0006, WorldPose)
* transform image points into world coordinate system (unit mm)
image_points_to_world_plane(FinalCamParam, WorldPose, PointRows, PointCols, \
'mm', PointXCoord, PointYCoord)
image_points_to_world_planeimage_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane returns 2 (H_MSG_TRUE) if all parameter values
are correct. If necessary, an exception is raised.
create_posecreate_posecreate_poseCreatePoseCreatePose,
hom_mat3d_to_posehom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPose,
camera_calibrationcamera_calibrationcamera_calibrationCameraCalibrationCameraCalibration,
hand_eye_calibrationhand_eye_calibrationhand_eye_calibrationHandEyeCalibrationHandEyeCalibration,
set_origin_poseset_origin_poseset_origin_poseSetOriginPoseSetOriginPose
contour_to_world_plane_xldcontour_to_world_plane_xldcontour_to_world_plane_xldContourToWorldPlaneXldContourToWorldPlaneXld
Calibration
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |