Skip to content

shape_trans_xldShapeTransXldShapeTransXldshape_trans_xldshape_trans_xld🔗

Short description🔗

shape_trans_xldShapeTransXldShapeTransXldshape_trans_xldshape_trans_xld — Transform the shape of contours or polygons.

Signature🔗

shape_trans_xld( xld XLD, out xld XLDTrans, string Type )void ShapeTransXld( const HObject& XLD, HObject* XLDTrans, const HTuple& Type )static void HOperatorSet.ShapeTransXld( HObject XLD, out HObject XLDTrans, HTuple type )def shape_trans_xld( xld: HObject, type: str ) -> HObject

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 )

HXLD HXLD::ShapeTransXld( const HString& Type ) const

HXLD HXLD::ShapeTransXld( const char* Type ) const

HXLD HXLD::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLDCont HXLDCont::ShapeTransXld( const HString& Type ) const

HXLDCont HXLDCont::ShapeTransXld( const char* Type ) const

HXLDCont HXLDCont::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLDPoly HXLDPoly::ShapeTransXld( const HString& Type ) const

HXLDPoly HXLDPoly::ShapeTransXld( const char* Type ) const

HXLDPoly HXLDPoly::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLDPara HXLDPara::ShapeTransXld( const HString& Type ) const

HXLDPara HXLDPara::ShapeTransXld( const char* Type ) const

HXLDPara HXLDPara::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLDModPara HXLDModPara::ShapeTransXld( const HString& Type ) const

HXLDModPara HXLDModPara::ShapeTransXld( const char* Type ) const

HXLDModPara HXLDModPara::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLDExtPara HXLDExtPara::ShapeTransXld( const HString& Type ) const

HXLDExtPara HXLDExtPara::ShapeTransXld( const char* Type ) const

HXLDExtPara HXLDExtPara::ShapeTransXld( const wchar_t* Type ) const (Windows only)

HXLD HXLD.ShapeTransXld( string type )

HXLDCont HXLDCont.ShapeTransXld( string type )

HXLDPoly HXLDPoly.ShapeTransXld( string type )

HXLDPara HXLDPara.ShapeTransXld( string type )

HXLDModPara HXLDModPara.ShapeTransXld( string type )

HXLDExtPara HXLDExtPara.ShapeTransXld( string type )

Description🔗

shape_transShapeTrans transforms the input contours or polygons depending on the parameter Typetypetype:

  • ‘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_xldTestSelfIntersectionXld).

  • ‘outer_circle’ Smallest enclosing circle.

  • ‘rectangle1’ Smallest enclosing rectangle parallel to the coordinate axes.

  • ‘rectangle2’ Smallest enclosing rectangle.

Execution information🔗

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🔗

XLDXLDxld (input_object) xld(-array) → objectHObjectHXLDHObjectHobject

Contours or polygons to be transformed.

XLDTransXLDTransxldtrans (output_object) xld(-array) → objectHObjectHXLDHObjectHobject *

Transformed contours respectively polygons.

Typetypetype (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of transformation.

Default: 'convex'"convex"
List of values: 'convex', 'ellipse', 'outer_circle', 'rectangle1', 'rectangle2'"convex", "ellipse", "outer_circle", "rectangle1", "rectangle2"

Result🔗

shape_trans_xldShapeTransXld 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>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_contours_skeleton_xldGenContoursSkeletonXld, edges_sub_pixEdgesSubPix, threshold_sub_pixThresholdSubPix, gen_contour_polygon_xldGenContourPolygonXld, test_self_intersection_xldTestSelfIntersectionXld

Alternatives

smallest_circle_xldSmallestCircleXld, smallest_rectangle1_xldSmallestRectangle1Xld, smallest_rectangle2_xldSmallestRectangle2Xld, elliptic_axis_xldEllipticAxisXld

See also

smallest_circle_xldSmallestCircleXld, smallest_rectangle1_xldSmallestRectangle1Xld, smallest_rectangle2_xldSmallestRectangle2Xld, elliptic_axis_xldEllipticAxisXld

Module🔗

Foundation