dilation_circle ( Region : RegionDilation : Radius : )

Dilate a region with a circular structuring element.

dilation_circle applies a Minkowski addition with a circular structuring element to the input regions Region. Because the circular mask is symmetrical, this is identical to a dilation. The size of the circle used as structuring element is determined by Radius.

The operator results in the region being enlarged, the smoothing of the region's boundaries, and the closing of holes smaller than the circular mask in the interior of the region. It is useful to select only values like 3.5, 5.5, etc. for Radius in order to avoid a translation of a region, because integer radii result in the circle having a non-integer center of gravity which is rounded to the next integer.


Attention

dilation_circle is applied to each input region separately. If gaps between different regions are to be closed, union1 or union2 has to be called first.


Parameters

Region (input_object)
region(-array) -> object
Regions to be dilated.

RegionDilation (output_object)
region(-array) -> object
Dilated regions.

Radius (input_control)
real -> real / integer
Radius of the circular structuring element.
Default value: 3.5
Suggested values: 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 12.5, 15.5, 19.5, 25.5, 33.5, 45.5, 60.5, 110.5
Range of values: 0.5 <= Radius <= 511.5 (lin)
Minimum increment: 1.0
Recommended increment: 1.0


Example
#include  
#include  "HCPP.H"

main()
{
  cout << "Reproduction of 'dilation_circle ()" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = before dilation " << endl;

  HByteImage img("affe");
  HWindow    w;

  HRegion      circ   = HRegion::Circle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray minadd = regs.MinkowskiAdd1 (circ, 1);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  minadd.Display (w);   w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();

  return(0);
}

Complexity

Let F1 be the area of an input region. Then the runtime for one region is:

       O(2 * Radius * sqrt(F1)) .


Result

dilation_circle returns TRUE if all parameters are correct. The behavior in case of empty or no input region can be set via:

  a) no region:    set_system(::'no_object_result',<RegionResult>:)
  b) empty region: set_system(::'empty_region_result',<RegionResult>:)
Otherwise, an exception is raised.


Possible Predecessors

threshold__, regiongrowing__, connection, union1, watersheds, class_ndim1__


Possible Successors

reduce_domain, select_shape, area_center, connection


Alternatives

minkowski_add1, minkowski_add2, expand, dilation1, dilation2, dilation_rectangle1


See also

circle, erosion_circle, closing_circle, opening_circle



Copyright © 1996-1997 MVTec Software GmbH