projective_trans_contour_xldT_projective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldprojective_trans_contour_xld (算子)
名称
projective_trans_contour_xldT_projective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldprojective_trans_contour_xld — 对 XLD 轮廓应用投影变换。
签名
def projective_trans_contour_xld(contours: HObject, hom_mat_2d: Sequence[float]) -> HObject
描述
projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXldprojective_trans_contour_xld applies the projective
transformation specified by the homogeneous matrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d
on the contours in ContoursContoursContoursContourscontourscontours and returns the transformed
contours in ContoursProjTransContoursProjTransContoursProjTransContoursProjTranscontoursProjTranscontours_proj_trans。
For creation and interpretation details of this matrix see also
projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImageprojective_trans_image。
注意
The used coordinate system is the same as in affine_trans_pixelaffine_trans_pixelAffineTransPixelAffineTransPixelAffineTransPixelaffine_trans_pixel。This
means that in fact not HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d is applied but a modified
version. Therefore, applying projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXldprojective_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_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXldarea_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_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotateHomMat2dRotatehom_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 HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d
before using it in projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXldprojective_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)
|
有关 HALCON 中使用的不同二维坐标系的说明,请参阅 变换 / 二维变换 一章的引言。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ContoursContoursContoursContourscontourscontours (输入对象) xld_cont(-array) → objectHXLDContHObjectHXLDContHobject
Input contours.
ContoursProjTransContoursProjTransContoursProjTransContoursProjTranscontoursProjTranscontours_proj_trans (输出对象) xld_cont(-array) → objectHXLDContHObjectHXLDContHobject *
Output contours.
HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (输入控制) hom_mat2d → HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Homogeneous projective transformation matrix.
可能的前趋
vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2dVectorToProjHomMat2dvector_to_proj_hom_mat2d,
hom_vector_to_proj_hom_mat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2dhom_vector_to_proj_hom_mat2d,
proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansacproj_match_points_ransac,
proj_match_points_ransac_guidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedproj_match_points_ransac_guided,
hom_mat3d_projecthom_mat3d_projectHomMat3dProjectHomMat3dProjectHomMat3dProjecthom_mat3d_project
另见
projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImageprojective_trans_image,
projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSizeprojective_trans_image_size,
projective_trans_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegionprojective_trans_region,
projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dProjectiveTransPoint2dprojective_trans_point_2d,
projective_trans_pixelprojective_trans_pixelProjectiveTransPixelProjectiveTransPixelProjectiveTransPixelprojective_trans_pixel
模块
基础