dilation_circle dilation_circle DilationCircle DilationCircle (Operator)
Name
dilation_circle dilation_circle DilationCircle DilationCircle
— Dilate a region with a circular structuring element.
Signature
Description
dilation_circle dilation_circle DilationCircle DilationCircle DilationCircle
applies a Minkowski addition with a
circular structuring element to the input regions Region Region Region Region region
.
Because the circular mask is symmetrical, this is identical to a
dilation. The size of the circle used as structuring element is
determined by Radius Radius Radius Radius radius
.
The operator results in enlarged regions, smoothed
region boundaries, and the holes smaller than the
circular mask in the interior of the region are closed. It is useful to select
only values like 3.5, 5.5, etc. for Radius Radius Radius Radius radius
in order
to avoid a translation of a region, because integer radii result in
the circle having a non-integer center of gravity which is rounded
to the next integer.
Attention
dilation_circle dilation_circle DilationCircle DilationCircle DilationCircle
is applied to each input region
separately. If gaps between different regions are to be closed,
union1 union1 Union1 Union1 Union1
or union2 union2 Union2 Union2 Union2
has to be called first.
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 to be dilated.
RegionDilation RegionDilation RegionDilation RegionDilation regionDilation
(output_object) region(-array) →
object HRegion HRegion Hobject *
Dilated regions.
Radius Radius Radius Radius radius
(input_control) real →
HTuple HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Radius of the circular structuring element.
Default value: 3.5
Suggested values: 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 12.5, 15.5, 19.5, 25.5, 33.5, 45.5, 60.5, 110.5
Typical range of values: 0.5
≤
Radius
Radius
Radius
Radius
radius
≤
511.5
(lin)
Minimum increment: 1.0
Recommended increment: 1.0
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_circle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = before dilation " << endl;
HByteImage img("monkey");
HWindow w;
HRegion circ = HRegion::GenCircle (10, 10, 1.5);
HRegionArray regs = (img >= 128).Connection();
HRegionArray minadd = regs.MinkowskiAdd1 (circ, 1);
img.Display (w); w.Click ();
w.SetColor ("blue"); minadd.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Example (C)
my_dilation_circle(Hobject In, double Radius, Hobject *Out)
{
Hobject Circle;
gen_circle(&Circle,100.0,100.0,Radius);
minkowski_add1(In,Circle,Out,1);
}
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_circle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = before dilation " << endl;
HByteImage img("monkey");
HWindow w;
HRegion circ = HRegion::GenCircle (10, 10, 1.5);
HRegionArray regs = (img >= 128).Connection();
HRegionArray minadd = regs.MinkowskiAdd1 (circ, 1);
img.Display (w); w.Click ();
w.SetColor ("blue"); minadd.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_circle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = before dilation " << endl;
HByteImage img("monkey");
HWindow w;
HRegion circ = HRegion::GenCircle (10, 10, 1.5);
HRegionArray regs = (img >= 128).Connection();
HRegionArray minadd = regs.MinkowskiAdd1 (circ, 1);
img.Display (w); w.Click ();
w.SetColor ("blue"); minadd.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_circle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = before dilation " << endl;
HByteImage img("monkey");
HWindow w;
HRegion circ = HRegion::GenCircle (10, 10, 1.5);
HRegionArray regs = (img >= 128).Connection();
HRegionArray minadd = regs.MinkowskiAdd1 (circ, 1);
img.Display (w); w.Click ();
w.SetColor ("blue"); minadd.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Complexity
Let F1 be the area of an input region. Then the runtime complexity for one
region is:
Result
dilation_circle dilation_circle DilationCircle DilationCircle DilationCircle
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
minkowski_add1 minkowski_add1 MinkowskiAdd1 MinkowskiAdd1 MinkowskiAdd1
,
minkowski_add2 minkowski_add2 MinkowskiAdd2 MinkowskiAdd2 MinkowskiAdd2
,
expand_region expand_region ExpandRegion ExpandRegion ExpandRegion
,
dilation1 dilation1 Dilation1 Dilation1 Dilation1
,
dilation2 dilation2 Dilation2 Dilation2 Dilation2
,
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 DilationRectangle1
See also
gen_circle gen_circle GenCircle GenCircle GenCircle
,
erosion_circle erosion_circle ErosionCircle ErosionCircle ErosionCircle
,
closing_circle closing_circle ClosingCircle ClosingCircle ClosingCircle
,
opening_circle opening_circle OpeningCircle OpeningCircle OpeningCircle
Module
Foundation