contour_to_world_plane_xld T_contour_to_world_plane_xld ContourToWorldPlaneXld ContourToWorldPlaneXld contour_to_world_plane_xld (Operator)
Name
contour_to_world_plane_xld T_contour_to_world_plane_xld ContourToWorldPlaneXld ContourToWorldPlaneXld contour_to_world_plane_xld
— Transform an XLD contour into the plane z=0 of a world coordinate system.
Signature
void ContourToWorldPlaneXld (const HObject& Contours , HObject* ContoursTrans , const HTuple& CameraParam , const HTuple& WorldPose , const HTuple& Scale )
HXLDCont HXLDCont ::ContourToWorldPlaneXld (const HTuple& CameraParam , const HPose& WorldPose , const HTuple& Scale ) const
HXLDCont HXLDCont ::ContourToWorldPlaneXld (const HTuple& CameraParam , const HPose& WorldPose , const HString& Scale ) const
HXLDCont HXLDCont ::ContourToWorldPlaneXld (const HTuple& CameraParam , const HPose& WorldPose , const char* Scale ) const
HXLDCont HXLDCont ::ContourToWorldPlaneXld (const HTuple& CameraParam , const HPose& WorldPose , const wchar_t* Scale ) const
(Windows only)
HXLDCont HPose ::ContourToWorldPlaneXld (const HXLDCont& Contours , const HTuple& CameraParam , const HTuple& Scale ) const
HXLDCont HPose ::ContourToWorldPlaneXld (const HXLDCont& Contours , const HTuple& CameraParam , const HString& Scale ) const
HXLDCont HPose ::ContourToWorldPlaneXld (const HXLDCont& Contours , const HTuple& CameraParam , const char* Scale ) const
HXLDCont HPose ::ContourToWorldPlaneXld (const HXLDCont& Contours , const HTuple& CameraParam , const wchar_t* Scale ) const
(Windows only)
static void HOperatorSet .ContourToWorldPlaneXld (HObject contours , out HObject contoursTrans , HTuple cameraParam , HTuple worldPose , HTuple scale )
HXLDCont HXLDCont .ContourToWorldPlaneXld (HTuple cameraParam , HPose worldPose , HTuple scale )
HXLDCont HXLDCont .ContourToWorldPlaneXld (HTuple cameraParam , HPose worldPose , string scale )
HXLDCont HPose .ContourToWorldPlaneXld (HXLDCont contours , HTuple cameraParam , HTuple scale )
HXLDCont HPose .ContourToWorldPlaneXld (HXLDCont contours , HTuple cameraParam , string scale )
def contour_to_world_plane_xld (contours : HObject, camera_param : Sequence[Union[int, float, str]], world_pose : Sequence[Union[int, float]], scale : Union[int, float, str]) -> HObject
Description
The operator contour_to_world_plane_xld contour_to_world_plane_xld ContourToWorldPlaneXld ContourToWorldPlaneXld ContourToWorldPlaneXld contour_to_world_plane_xld
transforms contour points
given in Contours Contours Contours Contours contours contours
into the plane z=0 in a world coordinate system
and returns the 3D contour points in ContoursTrans ContoursTrans ContoursTrans ContoursTrans contoursTrans contours_trans
. The world
coordinate system is chosen by passing its 3D pose relative to the camera
coordinate system in WorldPose WorldPose WorldPose WorldPose worldPose world_pose
.
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 CameraParam CameraParam CameraParam CameraParam cameraParam camera_param
you must pass the internal camera parameters
(see Calibration for the sequence of the parameters and
the underlying camera model).
In many cases CameraParam CameraParam CameraParam CameraParam cameraParam camera_param
and WorldPose WorldPose WorldPose WorldPose worldPose world_pose
are the result of
calibrating the camera with the operator calibrate_cameras calibrate_cameras CalibrateCameras CalibrateCameras CalibrateCameras calibrate_cameras
. See
below for an example.
With the parameter Scale Scale Scale Scale scale scale
you can scale the resulting 3D
coordinates.
The parameter Scale Scale Scale Scale scale 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' "m" "m" "m" "m" "m" , 'cm' "cm" "cm" "cm" "cm" "cm" , 'mm' "mm" "mm" "mm" "mm" "mm" or
'um' "um" "um" "um" "um" "um" for the parameter Scale Scale Scale Scale scale scale
.
Internally, the operator first computes the line of sight between the
projection center and the image point 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 WorldPose WorldPose WorldPose worldPose world_pose
. By
intersecting the plane z=0 with the line of sight the 3D coordinates of the
transformed contour ContoursTrans ContoursTrans ContoursTrans ContoursTrans contoursTrans contours_trans
are obtained.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Processed without parallelization.
Parameters
Contours Contours Contours Contours contours contours
(input_object) xld_cont(-array) →
object HXLDCont HObject HXLDCont Hobject
Input XLD contours to be transformed in image
coordinates.
ContoursTrans ContoursTrans ContoursTrans ContoursTrans contoursTrans contours_trans
(output_object) xld_cont(-array) →
object HXLDCont HObject HXLDCont Hobject *
Transformed XLD contours in world coordinates.
CameraParam CameraParam CameraParam CameraParam cameraParam camera_param
(input_control) number-array →
HTuple Sequence[Union[int, float, str]] HTuple Htuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Internal camera parameters.
WorldPose WorldPose WorldPose WorldPose worldPose world_pose
(input_control) pose →
HPose , HTuple Sequence[Union[int, float]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
3D pose of the world coordinate system in camera
coordinates.
Number of elements: 7
Scale Scale Scale Scale scale scale
(input_control) number →
HTuple Union[int, float, str] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Scale or dimension
Default value:
'm'
"m"
"m"
"m"
"m"
"m"
Suggested values: 'm' "m" "m" "m" "m" "m" , 'cm' "cm" "cm" "cm" "cm" "cm" , 'mm' "mm" "mm" "mm" "mm" "mm" , 'microns' "microns" "microns" "microns" "microns" "microns" , 'um' "um" "um" "um" "um" "um" , 1.0, 0.01, 0.001, 1.0e-6, 0.0254, 0.3048, 0.9144
Restriction: Scale > 0
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 contours into world coordinate system (unit mm).
contour_to_world_plane_xld(Contours, ContoursTrans, CamParam, \
WorldPose, 'mm')
Result
contour_to_world_plane_xld contour_to_world_plane_xld ContourToWorldPlaneXld ContourToWorldPlaneXld ContourToWorldPlaneXld contour_to_world_plane_xld
returns 2 (H_MSG_TRUE) if all parameter values
are correct. If necessary, an exception is raised.
Possible Predecessors
create_pose create_pose CreatePose CreatePose CreatePose create_pose
,
hom_mat3d_to_pose hom_mat3d_to_pose HomMat3dToPose HomMat3dToPose HomMat3dToPose hom_mat3d_to_pose
,
camera_calibration camera_calibration CameraCalibration CameraCalibration CameraCalibration camera_calibration
,
hand_eye_calibration hand_eye_calibration HandEyeCalibration HandEyeCalibration HandEyeCalibration hand_eye_calibration
,
set_origin_pose set_origin_pose SetOriginPose SetOriginPose SetOriginPose set_origin_pose
See also
image_points_to_world_plane image_points_to_world_plane ImagePointsToWorldPlane ImagePointsToWorldPlane ImagePointsToWorldPlane image_points_to_world_plane
Module
Calibration