shape_trans_xld ( XLD : XLDTrans : Type : )

Transform the shape of a contour.

shape_trans transforms the input contour depending on the parameter Type:

  'convex'
      Convex hull.

  'ellipse'
      Ellipse with the same moments and area as the input contour. The
      closed input contour must not intersect itself, otherwise the
      resulting ellipse is not meaningful.

  'outer_circle'
      Smallest enclosing circle.

  'rectangle1'
      Smallest enclosing rectangle parallel to the coordinate axes.

  'rectangle2'
      Smallest enclosing rectangle.


Parameters

XLD (input_object)
xld(-array) -> object
Contour(s) to be transformed.

XLDTrans (output_object)
xld(-array) -> object
Transformed contour(s).

Type (input_control)
string -> string
Type of transformation.
Default value: 'convex'
List of values: 'convex', 'ellipse', 'outer_circle', 'rectangle1', 'rectangle2'


Result

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


Parallelization Information

shape_trans_xld is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld


Alternatives

smallest_circle_xld, smallest_rectangle1_xld, smallest_rectangle2_xld, elliptic_axis_xld


See also

smallest_circle_xld, smallest_rectangle1_xld, smallest_rectangle2_xld, elliptic_axis_xld


Module

Sub-pixel operators



Copyright © 1996-2005 MVTec Software GmbH