boundaryboundaryBoundaryBoundaryboundary (算子名称)

名称

boundaryboundaryBoundaryBoundaryboundary — Reduce a region to its boundary.

参数签名

boundary(区域 : RegionBorder : BoundaryType : )

Herror boundary(const Hobject 区域, Hobject* RegionBorder, const char* BoundaryType)

Herror T_boundary(const Hobject 区域, Hobject* RegionBorder, const Htuple BoundaryType)

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

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

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

HRegion HRegion::Boundary(const wchar_t* BoundaryType) const   ( Windows only)

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

HRegion HRegion.Boundary(string boundaryType)

def boundary(区域: HObject, boundary_type: str) -> HObject

描述

boundaryboundaryBoundaryBoundaryBoundaryboundary computes the boundary of each input region in 区域区域区域区域区域区域 and returns them in RegionBorderRegionBorderRegionBorderRegionBorderregionBorderregion_border. The parameter BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryTypeboundary_type determines the type of boundary computation.

The contour computation is done using morphological operations. The resulting output regions consist only of the minimal border of the input regions. Their positions depend on the value of BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryTypeboundary_type, accepting the following values:

运行信息

参数表

区域区域区域区域区域区域 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regions for which the boundary is to be computed.

RegionBorderRegionBorderRegionBorderRegionBorderregionBorderregion_border (output_object)  region(-array) objectHRegionHObjectHRegionHobject *

Resulting boundaries.

BoundaryTypeBoundaryTypeBoundaryTypeBoundaryTypeboundaryTypeboundary_type (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Boundary type.

Default: '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);
}

例程 (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);
}

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 A be the area of the input region. Then the runtime complexity for one region is

结果

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.

可能的前置算子

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, union1union1Union1Union1Union1union1, watershedswatershedsWatershedsWatershedsWatershedswatersheds, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm

可能的后置算子

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, connectionconnectionConnectionConnectionConnectionconnection

可替代算子

dilation_circledilation_circleDilationCircleDilationCircleDilationCircledilation_circle, erosion_circleerosion_circleErosionCircleErosionCircleErosionCircleerosion_circle, differencedifferenceDifferenceDifferenceDifferencedifference

参考其它

fill_upfill_upFillUpFillUpFillUpfill_up

模块

Foundation