Enclosing rectangle parallel to the coordinate axes.
The operator smallest_rectangle1_xld calculates the enclosing rectangle for each input contour (parallel to the coordinate axes). The enclosing rectangle is described by the coordinates of the corner pixels (Row1,Column1,Row2,Column2)
If more than one contour is passed in XLD, the results are stored in tuples, the index of a value in the tuple corresponding to the index of a contour in the input. In case of an empty contour all parameters have the value 0 if no other behavior was set (see set_system).
In case of empty contours the result of Row1,Column1, Row2 and Column2 (all are 0) can lead to confusion.
|
XLD (input_object) |
xld(-array) -> object |
| Contour(s) to be examined. | |
|
Row1 (output_control) |
rectangle.origin.y(-array) -> real |
| Row coordinate of upper left corner point of the enclosing rectangle. | |
|
Column1 (output_control) |
rectangle.origin.x(-array) -> real |
| Column coordinate of upper left corner point of the enclosing rectangle. | |
|
Row2 (output_control) |
rectangle.corner.y(-array) -> real |
| Row coordinate of lower right corner point of the enclosing rectangle. | |
|
Column2 (output_control) |
rectangle.corner.x(-array) -> real |
| Column coordinate of lower right corner point of the enclosing rectangle. | |
If N is the number of contour points, the runtime complexity is O(N).
smallest_rectangle1_xld returns 2 (H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.
smallest_rectangle1_xld is reentrant and automatically parallelized (on tuple level).
gen_contours_skeleton_xld, edges_sub_pix, threshold_sub_pix, gen_contour_polygon_xld
smallest_rectangle2_xld, shape_trans_xld
shape_trans_xld, smallest_rectangle2_xld, smallest_circle_xld, elliptic_axis_xld, area_center_xld
Sub-pixel operators