boundary ( Region : RegionBorder : BoundaryType : )

Reduce a region to its boundary.

boundary computes the boundary of a region by using morphological operations. The parameter BoundaryType determines the type of boundary to compute:

'inner', 'inner_filled' and 'outer'.

boundary computes the contour of each input region. The resulting regions consist only of the minimal border of the input regions. If BoundaryType is set to 'inner', the contour lies within the original region, if it is set to 'outer', it is one pixel outside of the original region. If BoundaryType is set to 'inner_filled', holes in the interior of the input region are suppressed.


Parameters

Region (input_object)
region(-array) -> object
Regions for which the boundary is to be computed.

RegionBorder (output_object)
region(-array) -> object
Resulting boundaries.

BoundaryType (input_control)
string -> string
Boundary type.
Default value: 'inner'
List of values: 'inner', 'outer', 'inner_filled'


Example
#include "HCPP.H"

main()
{
  HWindow  w;
  HRegion  circ1 = HRegion::Circle (20, 10, 10.5);

  circ1.Display (w);
  w.Click ();

  HRegion marg1 = circ1.Boundary ("inner");
  w.SetColor ("red");
  marg1.Display (w);
  w.Click ();

  return(0);
}

Complexity

Let F be the area of the input region. Then the runtime complexity for one region is

      O(3 * sqrt(F)) .


Result

boundary 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

dilation_circle, erosion_circle, difference


See also

fill_up



Copyright © 1996-1997 MVTec Software GmbH