shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldshape_trans_xld (Operator)
Name
shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldshape_trans_xld
— Transform the shape of contours or polygons.
Signature
Herror shape_trans_xld(const Hobject XLD, Hobject* XLDTrans, const char* Type)
Herror T_shape_trans_xld(const Hobject XLD, Hobject* XLDTrans, const Htuple Type)
def shape_trans_xld(xld: HObject, type: str) -> HObject
Description
shape_transshape_transShapeTransShapeTransshape_trans
transforms the input contours or polygons
depending on the parameter TypeTypeTypetypetype
:
- 'convex'
Convex hull.
- 'ellipse'
Ellipse with the same moments and area as the input contour or polygon. The
closed input contour or polygon must not intersect itself, otherwise the
resulting ellipse is not meaningful(Whether the input contour or polygon
intersects itself or not can be determined with
test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld
).
- 'outer_circle'
Smallest enclosing circle.
- 'rectangle1'
Smallest enclosing rectangle parallel to the coordinate axes.
- 'rectangle2'
Smallest enclosing rectangle.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
XLDXLDXLDXLDxld
(input_object) xld(-array) →
objectHXLDHObjectHObjectHobject
Contours or polygons to be transformed.
XLDTransXLDTransXLDTransXLDTransxldtrans
(output_object) xld(-array) →
objectHXLDHObjectHObjectHobject *
Transformed contours respectively polygons.
TypeTypeTypetypetype
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Type of transformation.
Default:
'convex'
"convex"
"convex"
"convex"
"convex"
List of values:
'convex'"convex""convex""convex""convex", 'ellipse'"ellipse""ellipse""ellipse""ellipse", 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2"
Result
shape_trans_xldshape_trans_xldShapeTransXldShapeTransXldshape_trans_xld
returns 2 (
H_MSG_TRUE)
if all parameters are correct.
The behavior in case of empty input (no contours given) can be set
via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)
.
If necessary, an exception is raised.
Possible Predecessors
gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld
,
edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixedges_sub_pix
,
threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixthreshold_sub_pix
,
gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXldgen_contour_polygon_xld
,
test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXldtest_self_intersection_xld
Alternatives
smallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXldsmallest_circle_xld
,
smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld
,
smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld
,
elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldelliptic_axis_xld
See also
smallest_circle_xldsmallest_circle_xldSmallestCircleXldSmallestCircleXldsmallest_circle_xld
,
smallest_rectangle1_xldsmallest_rectangle1_xldSmallestRectangle1XldSmallestRectangle1Xldsmallest_rectangle1_xld
,
smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xldsmallest_rectangle2_xld
,
elliptic_axis_xldelliptic_axis_xldEllipticAxisXldEllipticAxisXldelliptic_axis_xld
Module
Foundation