Transform image points into the plane z=0 of a world coordinate system.
The operator image_points_to_world_plane transforms image points which are given in Rows and Cols into the plane z=0 in a world coordinate system and returns their 3D coordinates in X and Y. The world coordinate system is chosen by passing its 3D pose relative to the camera coordinate system in WorldPose. In CamParam you must pass the interior camera parameters (see write_cam_par for the sequence of the parameters and the underlying camera model).
In many cases CamParam and WorldPose are the result of calibrating the camera with the operator camera_calibration. See below for an example.
With the parameter Scale you can scale the resulting 3D coordinates. The parameter Scale 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', 'cm', 'mm' or 'µm' for the parameter Scale.
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 WorldPose. By intersecting the plane z=0 with the line of sight the 3D coordinates X and Y are obtained.
|
CamParam (input_control) |
number-array -> real / integer |
| Interior camera parameters. | |
| Number of elements: (CamParam == 8) || (CamParam == 11) | |
|
WorldPose (input_control) |
pose-array -> real / integer |
| 3D pose of the world coordinate system in camera coordinates. | |
| Number of elements: 7 | |
|
Rows (input_control) |
coordinates.y-array -> real / integer |
| Row coordinates of the points to be transformed. | |
| Default value: 100.0 | |
|
Cols (input_control) |
coordinates.x-array -> real / integer |
| Column coordinates of the points to be transformed. | |
| Default value: 100.0 | |
|
Scale (input_control) |
number -> string / integer / real |
| Scale or dimension | |
| Default value: 'm' | |
| Suggested values: 'm', 'cm', 'mm', 'microns', 'µm', 1.0, 0.01, 0.001, '1.0e-6', 0.0254, 0.3048, 0.9144 | |
|
X (output_control) |
coordinates.x-array -> real |
| X coordinates of the points in the world coordinate system. | |
|
Y (output_control) |
coordinates.y-array -> real |
| 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)
image_points_to_world_plane returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception handling is raised.
image_points_to_world_plane is reentrant and processed without parallelization.
create_pose, hom_mat3d_to_pose, camera_calibration, hand_eye_calibration, set_origin_pose
Calibration