Name
openingopeningOpeningopeningOpeningOpening — Auftrennen von Lücken.
Die openingopeningOpeningopeningOpeningOpening-Operation ist als die
Hintereinanderschaltung von Erosion und Minkowsi-Addition definiert.
Durch Anwendung von openingopeningOpeningopeningOpeningOpening bleiben größere Strukturen
weitgehend erhalten, kleine Regionen wie Linien und Punkte sowie
feine Strukturen werden gelöscht. Im Gegensatz dazu bewirkt eine
closingclosingClosingclosingClosingClosing-Operation, dass kleine Unterbrechungen, Lücken
und Risse erhalten bleiben bzw. ausgefüllt werden (siehe hierzu
closingclosingClosingclosingClosingClosing).
openingopeningOpeningopeningOpeningOpening dient zur Elimination von kleinen Regionen
(kleiner als StructElementStructElementStructElementStructElementStructElementstructElement) und zum Glätten der Ränder.
openingopeningOpeningopeningOpeningOpening verwendet intern als Bezugspunkt den Schwerpunkt
des strukturierenden Elementes. Die Position von
StructElementStructElementStructElementStructElementStructElementstructElement ist aber ohne Bedeutung, da Opening
translationsinvariant gegenüber dem strukturierende Element ist.
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).
Ergebnis des Opening-Operators.
* Large regions in an aerial picture (beech trees or meadows):
read_image(Image,'forest_road')
threshold(Image,Light,160,255)
gen_circle(StructElement,100,100,10)
* selecting the large regions
opening(Light,StructElement,Large)
* Selecting of edges with certain orientation:
read_image(Image,'fabrik')
sobel_amp(Image,Sobel,'sum_abs',3)
threshold(Sobel,Edges,10,255)
gen_rectangle2(StructElement,100,100,3.07819,20,1)
opening(Edges,StructElement,Direction)
/* simulation of opening */
my_opening(Hobject In, Hobject StructElement, Hobject *Out)
{
Hobject H;
erosion1(In,StructElement,&H,1);
minkowski_add1(H,StructElement,Out,1);
clear_obj(H);
}
/* Large regions in an aerial picture (beech trees or meadows): */
read_image(&Image,"forest_road");
threshold(Image,&Light,160.0,255.0);
gen_circle(&StructElement,100.0,100.0,10.0);
/* selecting the large regions */
opening(Light,StructElement,&Large);
/* Selecting of edges with certain orientation: */
read_image(&Image,"fabrik");
sobel_amp(Image,&Sobel,"sum_abs",3);
threshold(Sobel,Edges,30.0,255.0);
gen_rectangle2(&StructElement,100.0,100.0,3.07819,20.0,1.0);
opening(Edges,StructElement,&Direction);
* Large regions in an aerial picture (beech trees or meadows):
read_image(Image,'forest_road')
threshold(Image,Light,160,255)
gen_circle(StructElement,100,100,10)
* selecting the large regions
opening(Light,StructElement,Large)
* Selecting of edges with certain orientation:
read_image(Image,'fabrik')
sobel_amp(Image,Sobel,'sum_abs',3)
threshold(Sobel,Edges,10,255)
gen_rectangle2(StructElement,100,100,3.07819,20,1)
opening(Edges,StructElement,Direction)
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
HImage img("forest_road");
HWindow w;
cout << "Example: Large regions in an aerial picture: " << endl;
cout << "Beech Trees or Meadows" << endl;
/* Struct elements */
HRegion circ1 = HRegion::GenCircle (10, 10, 10);
HRegion rect1 = HRegion::GenRectangle2 (100, 100, 3.07819, 20, 1);
/* Segmentation, opening () -> select large regions */
HRegionArray regs = (img >= 160).Connection();
HRegionArray open = regs.Opening (circ1);
img.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
w.SetColor ("green"); open.Display (w); w.Click ();
cout << "Example: Selecting of edges with certain orientation" << endl;
HByteImage hbi ("fabrik");
HImage sobel = hbi.SobelAmp ("sum_abs", 3);
regs = (sobel >= 30).Connection ();
HRegionArray direc = regs.Opening (rect1);
hbi.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
w.SetColor ("blue"); sobel.Display (w); w.Click ();
w.SetColor ("green"); direc.Display (w); w.Click ();
return(0);
}
* Large regions in an aerial picture (beech trees or meadows):
read_image(Image,'forest_road')
threshold(Image,Light,160,255)
gen_circle(StructElement,100,100,10)
* selecting the large regions
opening(Light,StructElement,Large)
* Selecting of edges with certain orientation:
read_image(Image,'fabrik')
sobel_amp(Image,Sobel,'sum_abs',3)
threshold(Sobel,Edges,10,255)
gen_rectangle2(StructElement,100,100,3.07819,20,1)
opening(Edges,StructElement,Direction)
* Large regions in an aerial picture (beech trees or meadows):
read_image(Image,'forest_road')
threshold(Image,Light,160,255)
gen_circle(StructElement,100,100,10)
* selecting the large regions
opening(Light,StructElement,Large)
* Selecting of edges with certain orientation:
read_image(Image,'fabrik')
sobel_amp(Image,Sobel,'sum_abs',3)
threshold(Sobel,Edges,10,255)
gen_rectangle2(StructElement,100,100,3.07819,20,1)
opening(Edges,StructElement,Direction)
Sei F1 die Fläche einer Eingaberegion und F2 die Fläche des
strukturierenden Elementes, dann ist die Laufzeitkomplexität für
eine Region:
Bei korrekter Parametrisierung liefert die Funktion
openingopeningOpeningopeningOpeningOpening 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
reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain,
select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape,
area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter,
connectionconnectionConnectionconnectionConnectionConnection
minkowski_add1minkowski_add1MinkowskiAdd1minkowski_add1MinkowskiAdd1MinkowskiAdd1,
erosion1erosion1Erosion1erosion1Erosion1Erosion1,
opening_circleopening_circleOpeningCircleopening_circleOpeningCircleOpeningCircle
gen_circlegen_circleGenCirclegen_circleGenCircleGenCircle,
gen_rectangle2gen_rectangle2GenRectangle2gen_rectangle2GenRectangle2GenRectangle2,
gen_region_polygongen_region_polygonGenRegionPolygongen_region_polygonGenRegionPolygonGenRegionPolygon
Foundation