thinning_seq — Remove the result of a hit-or-miss operation from a region (sequential).
thinning_seq calculates the sequential thinning of the input regions with a structuring element from the Golay alphabet (GolayElement). To do so, thinning_seq calls the operator thinning_golay with all possible rotations of the structuring element Iterations times. If Iterations is chosen large enough, the operator calculates the skeleton of a region if the structuring elements 'l' or 'm' are used. For the element 'c' the background and foreground are exchanged in order to have an effect on the interior boundary of a region. If a very large value or 'maximal' is passed for Iterations the iteration stops if no more changes occur. The following structuring elements are available:
Skeleton, similar to skeleton. This structuring element is also used in morph_skiz.
A skeleton with many “hairs” and multiple (parallel) branches.
A skeleton without multiple branches, but with many gaps, similar to morph_skeleton.
Uniform erosion of the region.
One pixel wide lines are shortened. This structuring element is also used in morph_skiz.
Isolated points are removed. (Only Iterations = 1 is useful.)
Y-junctions are eliminated. (Only Iterations = 1 is useful.)
One pixel long branches and corners are removed. (Only Iterations = 1 is useful.)
A kind of inner boundary, which, however, is thicker than the result of boundary, is generated. (Only Iterations = 1 is useful.)
Junction points are eliminated, but also new ones are generated.
The Golay elements, together with all possible rotations, are described with the operator golay_elements.
Regions to be processed.
Result of the thinning operator.
Structuring element from the Golay alphabet.
Default value: 'l'
List of values: 'l', 'm', 'd', 'c', 'e', 'i', 'f', 'f2', 'h', 'k'
Number of iterations. For 'f', 'f2', 'h' and 'i' the only useful value is 1.
Default value: 20
Suggested values: 'maximal', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 40, 50, 70, 100, 150, 200
Typical range of values: 1 ≤ Iterations (lin)
Minimum increment: 1
Recommended increment: 1
Let F be the area of an input region. Then the runtime complexity for one region is:
O(Iterations * 6 * sqrt(F)) .
thinning_seq returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:
no region: set_system('no_object_result',<RegionResult>)
empty region: set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.
threshold, regiongrowing, connection, union1, watersheds, class_ndim_norm, gen_circle, gen_ellipse, gen_rectangle1, gen_rectangle2, draw_region, gen_region_points, gen_struct_elements, gen_region_polygon_filled
pruning, reduce_domain, select_shape, area_center, connection, complement
skeleton, morph_skiz, expand_region
hit_or_miss_seq, erosion_golay, difference, thinning_golay, thinning, thickening_seq