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.
|
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' | |
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.
shape_trans_xld is reentrant and automatically parallelized (on tuple level).
gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld
smallest_circle_xld, smallest_rectangle1_xld, smallest_rectangle2_xld, elliptic_axis_xld
smallest_circle_xld, smallest_rectangle1_xld, smallest_rectangle2_xld, elliptic_axis_xld
Sub-pixel operators