Determine the connected components of the background of given regions.
background_seg determines connected components of the background of the foreground regions given in Foreground. This operator is normally used after an edge operator in order to determine the regions enclosed by the extracted edges. The connected components are determined using 4-connectivity.
Foreground (input_object) |
region(-array) -> object |
Input regions. |
BackgroundRegions (output_object) |
region-array -> object |
Connected components of the background. |
/* Simulation of background_seg: */ background_seg(Foreground:BackgroundRegions::): complement__(Foreground:Background::) > get_system(::'neighbourhood':Save) > set_system(::'neighbourhood',4:) > connection(Background:BackgroundRegions::) > clear(Background:::) > set_system(::'neighbourhood',Save:). /* Segmentation with edge filter: */ read_image(:Image:'fabrik':) > sobel_dir(Image:Sobel,Dir:'sum_sqrt',3:) > threshold__(Sobel:Edges:20,255:) > skeleton(Edges:Margins::) > background_seg(Margins:Regions::).
Let F be the area of the background, H and W be the height and width of the image, and N be the number of resulting regions. Then the runtime complexity is O(H + F * N).
background_seg 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.
threshold__, connection, regiongrowing__, pouring, class_ndim1__
threshold__, hysteresis_threshold__, skeleton, expand, set_system, sobel_amp, edges__, roberts__, bandpass__