ClassesClassesClassesClasses | | | | Operators

boundaryboundaryBoundaryboundaryBoundaryBoundary (Operator)

Name

boundaryboundaryBoundaryboundaryBoundaryBoundary — Reduce a region to its boundary.

Signature

boundary(Region : RegionBorder : BoundaryType : )

Herror boundary(const Hobject Region, Hobject* RegionBorder, const char* BoundaryType)

Herror T_boundary(const Hobject Region, Hobject* RegionBorder, const Htuple BoundaryType)

Herror boundary(Hobject Region, Hobject* RegionBorder, const HTuple& BoundaryType)

HRegion HRegion::Boundary(const HTuple& BoundaryType) const

HRegionArray HRegionArray::Boundary(const HTuple& BoundaryType) const

void Boundary(const HObject& Region, HObject* RegionBorder, const HTuple& BoundaryType)

HRegion HRegion::Boundary(const HString& BoundaryType) const

HRegion HRegion::Boundary(const char* BoundaryType) const

void HOperatorSetX.Boundary(
[in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*RegionBorder, [in] VARIANT BoundaryType)

IHRegionX* HRegionX.Boundary([in] BSTR BoundaryType)

static void HOperatorSet.Boundary(HObject region, out HObject regionBorder, HTuple boundaryType)

HRegion HRegion.Boundary(string boundaryType)

Description

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

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

boundaryboundaryBoundaryboundaryBoundaryBoundary computes the contour of each input region. The resulting regions consist only of the minimal border of the input regions. If BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryType 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 BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryType is set to 'inner_filled', holes in the interior of the input region are suppressed.

Parallelization

Parameters

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions for which the boundary is to be computed.

RegionBorderRegionBorderRegionBorderRegionBorderRegionBorderregionBorder (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Resulting boundaries.

BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryType (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Boundary type.

Default value: 'inner' "inner" "inner" "inner" "inner" "inner"

List of values: 'inner'"inner""inner""inner""inner""inner", 'inner_filled'"inner_filled""inner_filled""inner_filled""inner_filled""inner_filled", 'outer'"outer""outer""outer""outer""outer"

Example (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"
using namespace Halcon;

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);
}

Example (C)

/* Intersections of two circles: */
gen_circle(&Circle1,200.0,100.0,100.5);
gen_circle(&Circle2,200.0,150.0,100.5);
boundary(Circle1,&Margin1,"inner");
boundary(Circle2,&Margin2,"inner");
intersection(Margin1,Margin2,&Intersections);
connection(Intersections,&Single);
T_area_center(Single,NULL,&Rows,&Columns);

/* simulation of Mode 'inner' */
void inner(Hobject Region, Hobject *Border)
{
  Hobject  Smaller;
  erosion_circle(Region,&Smaller,1.5);
  difference(Region,Smaller,Border);
  clear_obj(Smaller);
}

Example (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"
using namespace Halcon;

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);
}

Example (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"
using namespace Halcon;

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);
}

Example (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"
using namespace Halcon;

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);
}

Example (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"
using namespace Halcon;

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

boundaryboundaryBoundaryboundaryBoundaryBoundary returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

Otherwise, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionconnectionConnectionConnection, union1union1Union1union1Union1Union1, watershedswatershedsWatershedswatershedsWatershedsWatersheds, class_ndim_normclass_ndim_normClassNdimNormclass_ndim_normClassNdimNormClassNdimNorm

Possible Successors

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, connectionconnectionConnectionconnectionConnectionConnection

Alternatives

dilation_circledilation_circleDilationCircledilation_circleDilationCircleDilationCircle, erosion_circleerosion_circleErosionCircleerosion_circleErosionCircleErosionCircle, differencedifferenceDifferencedifferenceDifferenceDifference

See also

fill_upfill_upFillUpfill_upFillUpFillUp

Module

Foundation


ClassesClassesClassesClasses | | | | Operators