polar_trans_region — 将环形弧内的区域变换为极坐标。
polar_trans_region(Region : PolarTransRegion : Row, Column, AngleStart, AngleEnd, RadiusStart, RadiusEnd, Width, Height, Interpolation : )
polar_trans_region transforms a Region within the
annular arc specified by the center point (Row,
Column), the radii RadiusStart and
RadiusEnd and the angles AngleStart and
AngleEnd to its polar coordinate version in a virtual image
of the dimensions Width x Height。
The polar transformation is a change of the coordinate
system. Instead of a row and a column coordinate, each point's
position is expressed by its radius r (i.e. the distance to the
center point Row, Column) and the angle phi
between the column axis (through the center point) and the line from
the center point towards the point. Note that this transformation is
not affine.
The coordinate (0,0) in the output region always corresponds to
the point in the input region that is specified by
RadiusStart and AngleStart. Analogously, the
coordinate (Height-1, Width-1) corresponds to
the point in the input region that is specified by
RadiusEnd and AngleEnd. In the usual mode
(AngleStart < AngleEnd and RadiusStart
< RadiusEnd), the polar transformation is performed in
the mathematically positive orientation (counterclockwise).
Furthermore, points with smaller radii lie in the upper part of the
output region. By suitably exchanging the values of these
parameters (e.g., AngleStart > AngleEnd or
RadiusStart > RadiusEnd), any desired
orientation of the output region can be achieved.
The angles can be chosen from all real numbers. Center point and
radii can be real as well. However, if they are both integers and
the difference of RadiusEnd and RadiusStart equals
Height-1, calculation will be sped up through an
optimized routine.
The radii and angles are inclusive, which means that the first row
of the virtual target image contains the circle with radius
RadiusStart and the last row contains the circle with
radius RadiusEnd. For complete circles, where the
difference between AngleStart and AngleEnd equals
(360 degrees), this also means that the first
column of the target image will be the same as the last.
To avoid this, do not make this difference , but degrees instead.
The parameter Interpolation is used to select the
interpolation method 'bilinear' or
'nearest_neighbor'. Setting Interpolation to
'bilinear' leads to smoother region boundaries, especially
if regions are enlarged. However, the runtime increases
significantly.
If more than one region is passed in Region, their polar
transformations are computed individually and stored as a tuple in
PolarTransRegion. Please note that the indices of an
input region and its transformation only correspond if the system
variable 'store_empty_regions' is set to 'true'
(see set_system). Otherwise empty output regions are
discarded and the length of the input tuple Region is most
likely not equal to the length of the output tuple
PolarTransRegion。
有关 HALCON 中使用的不同二维坐标系的说明,请参阅 变换 / 二维变换 一章的引言。
If Width or Height are chosen greater than the
dimensions of the current image, the system variable
'clip_region' should be set to 'false' (see
set_system). Otherwise, an output region that does not lie
within the dimensions of the current image can produce an error
message.
Region (输入对象) region(-array) → object
Input region.
PolarTransRegion (输出对象) region(-array) → object
Output region.
Row (输入控制) number → (real / integer)
Row coordinate of the center of the arc.
默认值: 256
建议值: 0, 16, 32, 64, 128, 240, 256, 480, 512
Column (输入控制) number → (real / integer)
Column coordinate of the center of the arc.
默认值: 256
建议值: 0, 16, 32, 64, 128, 256, 320, 512, 640
AngleStart (输入控制) angle.rad → (real)
Angle of the ray to be mapped to column coordinate
0 of PolarTransRegion。
默认值: 0.0
建议值: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616
值范围:
-6.2831853
≤
AngleStart
≤
6.2831853
AngleEnd (输入控制) angle.rad → (real)
Angle of the ray to be mapped to column coordinate
Width-1 of PolarTransRegion。
默认值: 6.2831853
建议值: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616
值范围:
-6.2831853
≤
AngleEnd
≤
6.2831853
RadiusStart (输入控制) number → (real / integer)
Radius of the circle to be mapped to row coordinate
0 of PolarTransRegion。
默认值: 0
建议值: 0, 16, 32, 64, 100, 128, 256, 512
值范围:
0
≤
RadiusStart
≤
32767
RadiusEnd (输入控制) number → (real / integer)
Radius of the circle to be mapped to row coordinate
Height-1 of PolarTransRegion。
默认值: 100
建议值: 0, 16, 32, 64, 100, 128, 256, 512
值范围:
0
≤
RadiusEnd
≤
32767
Width (输入控制) extent.x → (integer)
Width of the virtual output image.
默认值: 512
建议值: 256, 320, 512, 640, 800, 1024
值范围:
2
≤
Width
≤
32767
Height (输入控制) extent.y → (integer)
Height of the virtual output image.
默认值: 512
建议值: 240, 256, 480, 512, 600, 1024
值范围:
2
≤
Height
≤
32767
Interpolation (输入控制) string → (string)
Interpolation method for the transformation.
默认值: 'nearest_neighbor'
值列表: 'bilinear', 'nearest_neighbor'
polar_trans_image_ext,
polar_trans_image_inv,
polar_trans_region_inv,
polar_trans_contour_xld,
polar_trans_contour_xld_inv
基础