projective_trans_contour_xld T_projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld (Operator)
Name
projective_trans_contour_xld T_projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld
— Apply a projective transformation to an XLD contour.
Signature
def projective_trans_contour_xld (contours : HObject, hom_mat_2d : Sequence[float]) -> HObject
Description
projective_trans_contour_xld projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld
applies the projective
transformation specified by the homogeneous matrix HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
on the contours in Contours Contours Contours Contours contours contours
and returns the transformed
contours in ContoursProjTrans ContoursProjTrans ContoursProjTrans ContoursProjTrans contoursProjTrans contours_proj_trans
.
For creation and interpretation details of this matrix see also
projective_trans_image projective_trans_image ProjectiveTransImage ProjectiveTransImage ProjectiveTransImage projective_trans_image
.
Attention
The used coordinate system is the same as in affine_trans_pixel affine_trans_pixel AffineTransPixel AffineTransPixel AffineTransPixel affine_trans_pixel
. This
means that in fact not HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
is applied but a modified
version. Therefore, applying projective_trans_contour_xld projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld
corresponds to
the following chain of transformations, which is applied to each point
of the contour (input and output
pixels as homogeneous vectors):
As an effect, you might get unexpected results when creating projective
transformations based on coordinates that are derived from the
contour, e.g., by operators like
area_center_xld area_center_xld AreaCenterXld AreaCenterXld AreaCenterXld area_center_xld
. For example, if you use this operator to calculate
the center of gravity of a rotationally symmetric XLD contour and then rotate
the contour around this point using hom_mat2d_rotate hom_mat2d_rotate HomMat2dRotate HomMat2dRotate HomMat2dRotate hom_mat2d_rotate
, the resulting
contour will not lie on the original one. In such a case, you can compensate
this effect by applying the following translations to HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
before using it in projective_trans_contour_xld projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld
:
hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp)
hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted)
projective_trans_contour_xld(Contours, ContoursAffineTrans, HomMat2DAdapted) projective_trans_contour_xld(Contours, ContoursAffineTrans, HomMat2DAdapted) ProjectiveTransContourXld(Contours, ContoursAffineTrans, HomMat2DAdapted) ProjectiveTransContourXld(Contours, ContoursAffineTrans, HomMat2DAdapted) ProjectiveTransContourXld(Contours, ContoursAffineTrans, HomMat2DAdapted) projective_trans_contour_xld(Contours, ContoursAffineTrans, HomMat2DAdapted)
For an explanation of the different 2D coordinate systems
used in HALCON, see the introduction of chapter
Transformations / 2D Transformations .
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 contours.
ContoursProjTrans ContoursProjTrans ContoursProjTrans ContoursProjTrans contoursProjTrans contours_proj_trans
(output_object) xld_cont(-array) →
object HXLDCont HObject HXLDCont Hobject *
Output contours.
HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
(input_control) hom_mat2d →
HHomMat2D , HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Homogeneous projective transformation matrix.
Possible Predecessors
vector_to_proj_hom_mat2d vector_to_proj_hom_mat2d VectorToProjHomMat2d VectorToProjHomMat2d VectorToProjHomMat2d vector_to_proj_hom_mat2d
,
hom_vector_to_proj_hom_mat2d hom_vector_to_proj_hom_mat2d HomVectorToProjHomMat2d HomVectorToProjHomMat2d HomVectorToProjHomMat2d hom_vector_to_proj_hom_mat2d
,
proj_match_points_ransac proj_match_points_ransac ProjMatchPointsRansac ProjMatchPointsRansac ProjMatchPointsRansac proj_match_points_ransac
,
proj_match_points_ransac_guided proj_match_points_ransac_guided ProjMatchPointsRansacGuided ProjMatchPointsRansacGuided ProjMatchPointsRansacGuided proj_match_points_ransac_guided
,
hom_mat3d_project hom_mat3d_project HomMat3dProject HomMat3dProject HomMat3dProject hom_mat3d_project
See also
projective_trans_image projective_trans_image ProjectiveTransImage ProjectiveTransImage ProjectiveTransImage projective_trans_image
,
projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
,
projective_trans_region projective_trans_region ProjectiveTransRegion ProjectiveTransRegion ProjectiveTransRegion projective_trans_region
,
projective_trans_point_2d projective_trans_point_2d ProjectiveTransPoint2d ProjectiveTransPoint2d ProjectiveTransPoint2d projective_trans_point_2d
,
projective_trans_pixel projective_trans_pixel ProjectiveTransPixel ProjectiveTransPixel ProjectiveTransPixel projective_trans_pixel
Module
Foundation