Herror ::boundary (
    Hobject Region,
    Hobject *RegionBorder,
    const HTuple &BoundaryType
)
HRegion HRegion::Boundary (
    const HTuple &BoundaryType
) const
HRegionArray HRegionArray::Boundary (
    const HTuple &BoundaryType
) const

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) -> Hobject: HRegion(Array)
Regions for which the boundary is to be computed.

RegionBorder (output_object)
region(-array) -> Hobject * : HRegion(Array)
Resulting boundaries.

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


Example
#include "HalconCpp.h"

main()
{
  HWindow  w;
  HRegion  circ1 = HRegion::GenCircle (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 H_MSG_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_ndim_norm


Possible Successors

::reduce_domain, ::select_shape, ::area_center, ::connection


Alternatives

::dilation_circle, ::erosion_circle, ::difference


See also

::fill_up


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH