Name
get_circle_poseT_get_circle_poseGetCirclePoseget_circle_poseGetCirclePoseGetCirclePose — Determine the 3D pose of a circle from its perspective 2D projection.
Herror get_circle_pose(Hobject Contour, const HTuple& CameraParam, const HTuple& Radius, const HTuple& OutputType, HTuple* Pose1, HTuple* Pose2)
HTuple HXLD::GetCirclePose(const HTuple& CameraParam, const HTuple& Radius, const HTuple& OutputType, HTuple* Pose2) const
HTuple HXLDArray::GetCirclePose(const HTuple& CameraParam, const HTuple& Radius, const HTuple& OutputType, HTuple* Pose2) const
void GetCirclePose(const HObject& Contour, const HTuple& CameraParam, const HTuple& Radius, const HTuple& OutputType, HTuple* Pose1, HTuple* Pose2)
HTuple HXLD::GetCirclePose(const HTuple& CameraParam, const HTuple& Radius, const HString& OutputType, HTuple* Pose2) const
HTuple HXLD::GetCirclePose(const HTuple& CameraParam, double Radius, const HString& OutputType, HTuple* Pose2) const
HTuple HXLD::GetCirclePose(const HTuple& CameraParam, double Radius, const char* OutputType, HTuple* Pose2) const
void HOperatorSetX.GetCirclePose(
[in] IHUntypedObjectX* Contour, [in] VARIANT CameraParam, [in] VARIANT Radius, [in] VARIANT OutputType, [out] VARIANT* Pose1, [out] VARIANT* Pose2)
VARIANT HXLDX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
VARIANT HXLDContX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
VARIANT HXLDPolyX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
VARIANT HXLDParaX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
VARIANT HXLDModParaX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
VARIANT HXLDExtParaX.GetCirclePose(
[in] VARIANT CameraParam, [in] VARIANT Radius, [in] BSTR OutputType, [out] VARIANT* Pose2)
static void HOperatorSet.GetCirclePose(HObject contour, HTuple cameraParam, HTuple radius, HTuple outputType, out HTuple pose1, out HTuple pose2)
HTuple HXLD.GetCirclePose(HTuple cameraParam, HTuple radius, string outputType, out HTuple pose2)
HTuple HXLD.GetCirclePose(HTuple cameraParam, double radius, string outputType, out HTuple pose2)
Each ellipse in an image can be interpreted as the perspective projection
of a circle into the image. In fact, for a given radius of the circle,
there exist two differently oriented circles in 3D that result in
the same projection. get_circle_poseget_circle_poseGetCirclePoseget_circle_poseGetCirclePoseGetCirclePose determines the 3D positions
and orientations of these two circles. First, each ContourContourContourContourContourcontour
is approximated by an ellipse. Then, based on the internal camera
parameters (CameraParamCameraParamCameraParamCameraParamCameraParamcameraParam) and the radius of the circle in 3D
(RadiusRadiusRadiusRadiusRadiusradius), the 3D positions and orientations
(Pose1Pose1Pose1Pose1Pose1pose1,Pose2Pose2Pose2Pose2Pose2pose2) are determined in camera coordinates.
Depending on the value of the parameter OutputTypeOutputTypeOutputTypeOutputTypeOutputTypeoutputType, the
position and orientation is returned as a 3D pose
(OutputTypeOutputTypeOutputTypeOutputTypeOutputTypeoutputType = 'pose'"pose""pose""pose""pose""pose") or in the form of the
center of the 3D circle and the normal vector of the plane in which
the circle lies (OutputTypeOutputTypeOutputTypeOutputTypeOutputTypeoutputType = 'center_normal'"center_normal""center_normal""center_normal""center_normal""center_normal").
In the former case, the angle for the rotation around the z axis
is set to zero, because it cannot be determined.
In the latter case, the first three elements of the output parameters
Pose1Pose1Pose1Pose1Pose1pose1 and Pose2Pose2Pose2Pose2Pose2pose2 contain the position of the center
of the circle. The following three elements contain the normal vector.
The normal vectors are normalized and oriented such that they point away
from the optical center which is the origin of the camera coordinate
system. If OutputTypeOutputTypeOutputTypeOutputTypeOutputTypeoutputType is set to 'center_normal'"center_normal""center_normal""center_normal""center_normal""center_normal",
the output parameters Pose1Pose1Pose1Pose1Pose1pose1 and Pose2Pose2Pose2Pose2Pose2pose2 contain only
six elements which describe the position and orientation of the circle
instead of the seven elements of the 3D pose that are returned if
OutputTypeOutputTypeOutputTypeOutputTypeOutputTypeoutputType is set to 'pose'"pose""pose""pose""pose""pose".
If more than one contour is passed in ContourContourContourContourContourcontour, RadiusRadiusRadiusRadiusRadiusradius
must either contain a tuple that contains a value for each contour or
only one value which is then used for all contours. The resulting
positions and orientations are stored one after another in Pose1Pose1Pose1Pose1Pose1pose1
and Pose2Pose2Pose2Pose2Pose2pose2, i.e., Pose1Pose1Pose1Pose1Pose1pose1 and Pose2Pose2Pose2Pose2Pose2pose2 contain
first the pose or the position and the normal vector of the first
contour, followed by the respective values for the second contour
and so on.
The accuracy of the determined poses depends heavily on the accuracy of
the extracted contours.
The extraction of curved edges using relatively large filter masks leads
to a slightly shifted edge position. Edge extraction approaches that
are based on the first derivative of the image function
(e.g., edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix) yield edges that are shifted towards the
center of curvature, i.e., extracted ellipses will be slightly to small.
Approaches that are based on the second derivative of the image function
(laplace_of_gausslaplace_of_gaussLaplaceOfGausslaplace_of_gaussLaplaceOfGaussLaplaceOfGauss followed by zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix)
result in edges that are shifted away from the center of curvature, i.e.,
extracted ellipses will be slightly too large.
These effects increase with the curvature of the edge and with the size
of the filter mask that is used for the edge extraction. Therefore, to
achieve high accuracy, the ellipses should appear large in the image
and the filter parameter should be chosen such that small filter masks
are used (see info_edgesinfo_edgesInfoEdgesinfo_edgesInfoEdgesInfoEdges).
- 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 == 10 || CameraParam == 12 || CameraParam == 14
Radius of the circle in object space.
Number of elements: Radius == Contour || Radius == 1
Restriction: Radius > 0.0
Type of output parameters.
Default value:
'pose'
"pose"
"pose"
"pose"
"pose"
"pose"
List of values: 'center_normal'"center_normal""center_normal""center_normal""center_normal""center_normal", 'pose'"pose""pose""pose""pose""pose"
3D pose of the first circle.
Number of elements: Pose1 == 7 * Contour || Pose1 == 6 * Contour
3D pose of the second circle.
Number of elements: Pose2 == 7 * Contour || Pose2 == 6 * Contour
get_circle_poseget_circle_poseGetCirclePoseget_circle_poseGetCirclePoseGetCirclePose returns 2 (H_MSG_TRUE) if all parameter values are
correct and the position of the circle has been determined successfully.
If necessary, an exception is raised.
edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix
find_marks_and_posefind_marks_and_poseFindMarksAndPosefind_marks_and_poseFindMarksAndPoseFindMarksAndPose,
camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration
get_rectangle_poseget_rectangle_poseGetRectanglePoseget_rectangle_poseGetRectanglePoseGetRectanglePose,
fit_ellipse_contour_xldfit_ellipse_contour_xldFitEllipseContourXldfit_ellipse_contour_xldFitEllipseContourXldFitEllipseContourXld
3D Metrology