Name
opening_segopening_segOpeningSegopening_segOpeningSegOpeningSeg — Trennen von sich überlappenden Regionen.
Die opening_segopening_segOpeningSegopening_segOpeningSegOpeningSeg-Operation ist als die
Hintereinanderschaltung von erosion1erosion1Erosion1erosion1Erosion1Erosion1,
connectionconnectionConnectionconnectionConnectionConnection und dilation1dilation1Dilation1dilation1Dilation1Dilation1 definiert (siehe
Beispiel). Es wird dabei nur eine Iteration bei
erosion1erosion1Erosion1erosion1Erosion1Erosion1 und dilation1dilation1Dilation1dilation1Dilation1Dilation1 ausgeführt.
opening_segopening_segOpeningSegopening_segOpeningSegOpeningSeg dient zum Trennen von sich überlappenden
Regionen, deren Überlappungsbereich kleiner als
StructElementStructElementStructElementStructElementStructElementstructElement ist. Es ist zu beachten, dass sich die
Ergebnisregionen überlappen können ohne dabei zu verschmelzen
(siehe expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion). opening_segopening_segOpeningSegopening_segOpeningSegOpeningSeg verwendet als
Bezugspunkt den Schwerpunkt des strukturierenden Elementes.
Das strukturierende Element StructElementStructElementStructElementStructElementStructElementstructElement kann mit
Operatoren wie gen_circlegen_circleGenCirclegen_circleGenCircleGenCircle, gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1,
gen_rectangle2gen_rectangle2GenRectangle2gen_rectangle2GenRectangle2GenRectangle2, gen_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse,
draw_regiondraw_regionDrawRegiondraw_regionDrawRegionDrawRegion, gen_region_polygongen_region_polygonGenRegionPolygongen_region_polygonGenRegionPolygonGenRegionPolygon,
gen_region_pointsgen_region_pointsGenRegionPointsgen_region_pointsGenRegionPointsGenRegionPoints, etc. erzeugt werden.
- 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.
Strukturierendes Element (lageinvariant).
Das Ergebnis des Opening-Operators.
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
/* Simulation of opening_seg */
my_opening_seg(Hobject Region, Hobject StructElement, Hobject *Opening)
{
Hobject H1,H2;
erosion1(Region,StructElement,&H1,1);
connection(H1,&H2);
dilation1(H2,StructElement,Opening,1);
clear_obj(H1); clear_obj(H2);
}
/* separation of circular objects */
gen_random_regions(&Regions,"circle",8.5,10.5,0.0,0.0,0.0,0.0,400,512,512);
union1(Regions,&UnionReg);
gen_circle(&Mask,100,100,8.5);
opening_seg(UnionReg,Mask,&RegionsNew);
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
HWindow w;
HRegionArray regs = HRegionArray::GenRandomRegions("circle",8.5,10.5,
0,0,0,0,400,512,512);
HRegionArray ureg = regs.Union1();
HRegion crc = HRegion::GenCircle(100,100,8.5);
HRegionArray ops = ureg.OpeningSeg(crc);
w.SetColor("red"); regs.Display(w); w.Click();
w.SetColored(12); ops.Display(w); w.Click();
return(0);
}
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
Sei F1 die Fläche einer Eingaberegion und F2 die Fläche des
strukturierenden Elementes, dann ist die Laufzeitkomplexität für
ein Objekt:
Bei korrekter Parametrisierung liefert die Funktion
opening_segopening_segOpeningSegopening_segOpeningSegOpeningSeg 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.
thresholdthresholdThresholdthresholdThresholdThreshold,
regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing,
connectionconnectionConnectionconnectionConnectionConnection,
union1union1Union1union1Union1Union1,
watershedswatershedsWatershedswatershedsWatershedsWatersheds,
class_ndim_normclass_ndim_normClassNdimNormclass_ndim_normClassNdimNormClassNdimNorm,
gen_circlegen_circleGenCirclegen_circleGenCircleGenCircle,
gen_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse,
gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1,
gen_rectangle2gen_rectangle2GenRectangle2gen_rectangle2GenRectangle2GenRectangle2,
draw_regiondraw_regionDrawRegiondraw_regionDrawRegionDrawRegion,
gen_region_pointsgen_region_pointsGenRegionPointsgen_region_pointsGenRegionPointsGenRegionPoints,
gen_struct_elementsgen_struct_elementsGenStructElementsgen_struct_elementsGenStructElementsGenStructElements,
gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled
expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion,
reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain,
select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape,
area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter,
connectionconnectionConnectionconnectionConnectionConnection
erosion1erosion1Erosion1erosion1Erosion1Erosion1,
connectionconnectionConnectionconnectionConnectionConnection,
dilation1dilation1Dilation1dilation1Dilation1Dilation1
Foundation