boundary boundary Boundary Boundary (Operator)
Name
boundary boundary Boundary Boundary
— Reduce a region to its boundary.
Signature
Description
boundary boundary Boundary Boundary Boundary
computes the boundary of a region by using
morphological operations. The parameter BoundaryType BoundaryType BoundaryType BoundaryType boundaryType
determines the type of boundary to compute:
'inner', 'inner_filled' and 'outer'.
boundary boundary Boundary Boundary Boundary
computes the contour of each input region. The
resulting regions consist only of the minimal border of the input
regions. If BoundaryType BoundaryType BoundaryType BoundaryType 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 BoundaryType BoundaryType BoundaryType boundaryType
is
set to 'inner_filled', holes in the interior of the input region are
suppressed.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on tuple level.
Parameters
Region Region Region Region region
(input_object) region(-array) →
object HRegion HRegion Hobject
Regions for which the boundary is to be computed.
RegionBorder RegionBorder RegionBorder RegionBorder regionBorder
(output_object) region(-array) →
object HRegion HRegion Hobject *
Resulting boundaries.
BoundaryType BoundaryType BoundaryType BoundaryType boundaryType
(input_control) string →
HTuple HTuple Htuple (string) (string ) (HString ) (char* )
Boundary type.
Default value:
'inner'
"inner"
"inner"
"inner"
"inner"
List of values: 'inner' "inner" "inner" "inner" "inner" , 'inner_filled' "inner_filled" "inner_filled" "inner_filled" "inner_filled" , '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);
}
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
Result
boundary boundary Boundary Boundary Boundary
returns 2 (H_MSG_TRUE) if all parameters are correct. The
behavior in case of empty or no input region can be set via:
no region:
set_system('no_object_result',<RegionResult>)
empty region:
set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.
Possible Predecessors
threshold threshold Threshold Threshold Threshold
,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing
,
connection connection Connection Connection Connection
,
union1 union1 Union1 Union1 Union1
,
watersheds watersheds Watersheds Watersheds Watersheds
,
class_ndim_norm class_ndim_norm ClassNdimNorm ClassNdimNorm ClassNdimNorm
Possible Successors
reduce_domain reduce_domain ReduceDomain ReduceDomain ReduceDomain
,
select_shape select_shape SelectShape SelectShape SelectShape
,
area_center area_center AreaCenter AreaCenter AreaCenter
,
connection connection Connection Connection Connection
Alternatives
dilation_circle dilation_circle DilationCircle DilationCircle DilationCircle
,
erosion_circle erosion_circle ErosionCircle ErosionCircle ErosionCircle
,
difference difference Difference Difference Difference
See also
fill_up fill_up FillUp FillUp FillUp
Module
Foundation