Name
dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 — Ausführen einer Dilatation mit einem Rechteck.
dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1DilationRectangle1 führt eine Dilatation auf der/den
angegebenen Region(en) RegionRegionRegionRegionregion durch. Das strukturierende
Element für diese Operation bildet ein Rechteck mit der Größe
WidthWidthWidthWidthwidth x HeightHeightHeightHeightheight. Die Funktion führt
zu einer Expansion der Region und zum Schließen von Löchern, die
kleiner als das angegebene Rechteck sind, innerhalb der Regionen.
dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1DilationRectangle1 ist eine sehr schnelle Operation, da die
Höhe des Rechtecks nur logarithmisch, die Breite gar nicht in die
Komplexita"t eingeht. Dies führt auch bei sehr großen Rechtecken
(Kante > 100) zu einem sehr gutem Laufzeitverhalten.
dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1DilationRectangle1 wird für jede Region einzeln
angewandt. Sollen Lücken zwischen den Regionen geschlossen werden,
dann muss vorher ein union1union1Union1Union1Union1 oder union2union2Union2Union2Union2
ausgeführt werden.
Damit eine Region in alle Richtungen gleichmäßig vergrößert wird,
müssen WidthWidthWidthWidthwidth und HeightHeightHeightHeightheight ungerade sein. Falls das
nicht der Fall ist, wird die Region rechts bzw. unten um ein Pixel
weiter dilatiert als nach bzw. oben.
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Automatisch parallelisiert auf Tupelebene.
Regionen die verarbeitet werden sollen.
Ergebnis der Dilation-Operation.
Breite des Rechtecks.
Defaultwert: 11
Wertevorschläge: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
Typischer Wertebereich: 1
≤
Width
Width
Width
Width
width
≤
511 (lin)
Minimale Schrittweite: 1
Empfohlene Schrittweite: 10
Höhe des Rechtecks.
Defaultwert: 11
Wertevorschläge: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
Typischer Wertebereich: 1
≤
Height
Height
Height
Height
height
≤
511 (lin)
Minimale Schrittweite: 1
Empfohlene Schrittweite: 10
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
threshold(Image,&Light,220.0,255.0);
dilation_rectangle1(Light,&Wide,50,50);
set_color(WindowHandle,"red");
disp_region(Wide,WindowHandle);
set_color(WindowHandle,"white");
disp_region(Light,WindowHandle);
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Sei F1 die Fläche einer Eingaberegion und H die Höhe des
Rechtecks, dann ist die Laufzeitkomplexität für eine Region:
Bei korrekter Parametrisierung liefert die Funktion
dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1DilationRectangle1 den Wert 2 (H_MSG_TRUE). Das
Funktionsverhalten für die beiden Fälle leere und keine
Eingaberegion lässt sich wie folgt kontrollieren:
-
keine Region:
set_system('no_object_result',<RegionResult>)
-
leere Region:
set_system('empty_region_result',<RegionResult>)
Andernfalls wird eine Fehlerbehandlung durchgeführt.
thresholdthresholdThresholdThresholdThreshold,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing,
connectionconnectionConnectionConnectionConnection,
union1union1Union1Union1Union1,
watershedswatershedsWatershedsWatershedsWatersheds,
class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain,
select_shapeselect_shapeSelectShapeSelectShapeSelectShape,
area_centerarea_centerAreaCenterAreaCenterAreaCenter,
connectionconnectionConnectionConnectionConnection
minkowski_add1minkowski_add1MinkowskiAdd1MinkowskiAdd1MinkowskiAdd1,
minkowski_add2minkowski_add2MinkowskiAdd2MinkowskiAdd2MinkowskiAdd2,
expand_regionexpand_regionExpandRegionExpandRegionExpandRegion,
dilation1dilation1Dilation1Dilation1Dilation1,
dilation2dilation2Dilation2Dilation2Dilation2,
dilation_circledilation_circleDilationCircleDilationCircleDilationCircle
gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1,
gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilled
Foundation