Compute connected components of a region.
connection determines the connected components of the input regions given in Region. The neighborhood used for this can be set via set_system(::'neighbourhood',<4/8>:) The default is 8-neighborhood, which is useful for determining the connected components of the foreground. The inverse operator of connection is union1.
Region (input_object) |
region(-array) -> object |
Input region. |
ConnectedRegions (output_object) |
region-array -> object |
Connected components. |
read_image(:Image:'affe':) set_colored(::12:) threshold__(Image:Light:150.0,255.0:) count_obj(Light:::Number1) fwrite_string(::'Nummber of regions after threshold = '+Number1:) fnew_line(:::) disp_region(Light:::) connection(Light:Many::) count_obj(Many:::Number2) fwrite_string(::'Nummber of regions after threshold = '+Number2:) fnew_line(:::) disp_region(Many:::)
Let F be the area of the input region and N be the number of generated connected components. Then the runtime complexity is O(F * N).
connection always returns the value TRUE. The behavior in case of empty input (no regions given) can be set via set_system(::'no_object_result',<Result>:) and the behavior in case of an empty input region via set_system(::'empty_region_result',<Result>:). If necessary, an exception is raised.
auto_threshold2, threshold__, dyn_threshold__, erosion1
select_shape, select_grey__, shape_trans, set_colored, dilation1, count_obj, reduce_domain, add_channels