projective_trans_region T_projective_trans_region ProjectiveTransRegion ProjectiveTransRegion projective_trans_region (算子)
名称
projective_trans_region T_projective_trans_region ProjectiveTransRegion ProjectiveTransRegion projective_trans_region — 对区域应用投影变换。
签名
描述
projective_trans_region projective_trans_region ProjectiveTransRegion ProjectiveTransRegion ProjectiveTransRegion projective_trans_region applies the projective
transformation specified by the homogeneous matrix HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
on the regions in Regions Regions Regions Regions regions regions and returns the transformed
regions in TransRegions TransRegions TransRegions TransRegions transRegions trans_regions 。
For creation and interpretation details of this matrix see also
projective_trans_image projective_trans_image ProjectiveTransImage ProjectiveTransImage ProjectiveTransImage projective_trans_image 。
If 'clip_region' "clip_region" "clip_region" "clip_region" "clip_region" "clip_region" is set to its default value
'true' "true" "true" "true" "true" "true" by set_system('clip_region', 'true') set_system("clip_region", "true") SetSystem("clip_region", "true") SetSystem("clip_region", "true") SetSystem("clip_region", "true") set_system("clip_region", "true") or if
the transformation is degenerated and thus produces infinite
regions, the output region is clipped by the rectangle with upper
left corner (0, 0) and lower right corner ('width' "width" "width" "width" "width" "width" ,
'height' "height" "height" "height" "height" "height" ), where 'width' "width" "width" "width" "width" "width" and 'height' "height" "height" "height" "height" "height" are
system variables (see also get_system get_system GetSystem GetSystem GetSystem get_system ). If
'clip_region' "clip_region" "clip_region" "clip_region" "clip_region" "clip_region" is 'false' "false" "false" "false" "false" "false" , the output region is not
clipped except by the maximum supported coordinate size
'MAX_FORMAT' "MAX_FORMAT" "MAX_FORMAT" "MAX_FORMAT" "MAX_FORMAT" "MAX_FORMAT" . This may result in extremely memory and time
intensive computations, so use with care.
注意
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_region projective_trans_region ProjectiveTransRegion ProjectiveTransRegion ProjectiveTransRegion projective_trans_region corresponds to
the following chain of transformations, which is applied to each point
of the region (input and output
pixels as homogeneous vectors):
因此,当基于区域派生的坐标(例如通过
area_center area_center AreaCenter AreaCenter AreaCenter area_center 等算子)创建投影变换时,可能会得到意外的结果。例如,若使用此算子计算旋转对称区域的重心,随后通过
hom_mat2d_rotate hom_mat2d_rotate HomMat2dRotate HomMat2dRotate HomMat2dRotate hom_mat2d_rotate 围绕该点旋转该区域,则旋转后的区域将不会位于原始区域之上。在这种情况下,您可以在将
HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
用于
projective_trans_region projective_trans_region ProjectiveTransRegion ProjectiveTransRegion ProjectiveTransRegion projective_trans_region 之前,通过应用以下变换来补偿这种影响:
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_region(Region, TransRegion, HomMat2DAdapted, 'bilinear') projective_trans_region(Region, TransRegion, HomMat2DAdapted, "bilinear") ProjectiveTransRegion(Region, TransRegion, HomMat2DAdapted, "bilinear") ProjectiveTransRegion(Region, TransRegion, HomMat2DAdapted, "bilinear") ProjectiveTransRegion(Region, TransRegion, HomMat2DAdapted, "bilinear") projective_trans_region(Region, TransRegion, HomMat2DAdapted, "bilinear")
有关 HALCON 中使用的不同二维坐标系的说明,请参阅 变换 / 二维变换 一章的引言。
执行信息
多线程类型:可重入(与非独占算子并行运行)。
多线程作用域:全局(可从任何线程调用)。
在元组级别上自动并行化。
参数
Regions Regions Regions Regions regions regions (输入对象) region(-array) → object HRegion HObject HRegion Hobject
Input regions.
TransRegions TransRegions TransRegions TransRegions transRegions trans_regions (输出对象) region(-array) → object HRegion HObject HRegion Hobject *
Output regions.
HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d (输入控制) hom_mat2d → HHomMat2D , HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Homogeneous projective transformation matrix.
Interpolation Interpolation Interpolation Interpolation interpolation interpolation (输入控制) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Interpolation method for the transformation.
默认值:
'bilinear'
"bilinear"
"bilinear"
"bilinear"
"bilinear"
"bilinear"
值列表:
'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear" , 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor"
可能的前趋
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
另见
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_contour_xld projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld ,
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
模块
基础