expand ( Regions, ForbiddenArea : RegionExpanded : Iterations, Mode : )

Fill gaps between regions or split overlapping regions.

expand closes gaps between the input regions, which resulted from the suppression of small regions in a segmentation operator, for example, (mode 'image'), or to separate overlapping regions 'region'). Both uses result from the expansion of regions. The operator works by adding or removing a one pixel wide ``strip'' to a region.

The expansion takes place only in regions, which are designated as not ``forbidden'' (parameter ForbiddenArea). The number of iterations is determined by the parameter Iterations. By passing 'maximal', expand iterates until convergence, i.e., until no more changes occur. By passing 0 for this parameter, all non-overlapping regions are returned. The two modes of operation ('image' and 'region') are different in the following ways:

  'image'
          The input regions are expanded iteratively until they
          touch another region or the image border.  Because
          expand processes all regions simultaneously, gaps between
          regions are distributed evenly to all regions.
          Overlapping regions are split by distributing the area of
          overlap evenly to both regions.

  'region'
          No expansion of the input regions is performed.  Instead,
          only overlapping regions are split by distributing the
          area of overlap evenly to the respective regions.  Because
          the intersection with the original region is computed
          after the shrinking operation gaps in the output regions
          may result, i.e., the segmentation is not complete.  This
          can be prevented by calling expand a second time with the
          complement of the original regions as ``forbidden area.''


Parameters

Regions (input_object)
region(-array) -> object
Regions for which the gaps are to be closed, or which are to be separated.

ForbiddenArea (input_object)
region -> object
Regions in which no expasion takes place.

RegionExpanded (output_object)
region(-array) -> object
Expanded or separated regions.

Iterations (input_control)
integer -> integer / string
Number of iterations.
Default value: 'maximal'
Suggested values: 'maximal', 1, 2, 3, 5, 7, 10, 15, 20, 30, 50, 70, 100, 200
Range of values: 1 <= Iterations <= 1000 (lin)
Minimum increment: 1
Recommended increment: 1

Mode (input_control)
string -> string
Expansion mode.
Default value: 'image'
List of values: 'image', 'region'


Example
read_image(:Image:'fabrik':)
threshold__(Image:Light:100,255:)
disp_region(Light:::)
connection(Light:Seg::)
expand(Seg,[]:Exp1:'maximal','image':)
set_colored(::12:)
set_draw(::'margin':)
disp_region(Exp1:::)

Result

expand 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>:), the behavior in case of an empty input region via set_system(::'empty_region_result',<Result>:), and the behavior in case of an empty result region via set_system(::'store_empty_region',<true/false>:). If necessary, an exception is raised.


Possible Predecessors

pouring, threshold__, dyn_threshold__, regiongrowing__


Alternatives

dilation1


See also

expand_grey1, interjacent, skeleton



Copyright © 1996-1997 MVTec Software GmbH