KlassenKlassenKlassenKlassen | | | | Operatoren

bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat (Operator)

Name

bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat — Ermitteln von Lücken zwischen Regionen.

Signatur

bottom_hat(Region, StructElement : RegionBottomHat : : )

Herror bottom_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionBottomHat)

Herror T_bottom_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionBottomHat)

Herror bottom_hat(Hobject Region, Hobject StructElement, Hobject* RegionBottomHat)

HRegion HRegion::BottomHat(const HRegion& StructElement) const

HRegionArray HRegionArray::BottomHat(const HRegion& StructElement) const

void BottomHat(const HObject& Region, const HObject& StructElement, HObject* RegionBottomHat)

HRegion HRegion::BottomHat(const HRegion& StructElement) const

void HOperatorSetX.BottomHat(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* StructElement, [out] IHUntypedObjectX*RegionBottomHat)

IHRegionX* HRegionX.BottomHat([in] IHRegionX* StructElement)

static void HOperatorSet.BottomHat(HObject region, HObject structElement, out HObject regionBottomHat)

HRegion HRegion.BottomHat(HRegion structElement)

Beschreibung

bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat berechnet die Bottom-Hat-Operation, indem zunächst eine Closing-Operation mit StructElementStructElementStructElementStructElementStructElementstructElement (siehe closingclosingClosingclosingClosingClosing) durchgeführt wird. Von diesem Zwischenergebnis wird die Originalregion abgezogen. Im Gegensatz zu closingclosingClosingclosingClosingClosing, das aus Einzelregionen bei entsprechender Voraussetzung mehrere Regionen zu einer größeren zusammenschließt, bestimmt bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat die Region, welche für diesen Zusammenschluss notwendig ist.

Die Position von StructElementStructElementStructElementStructElementStructElementstructElement ist ohne Bedeutung, da die Closing-Operation translationsinvariant bzgl. StructElementStructElementStructElementStructElementStructElementstructElement ist.

Das struktuirierende 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.

Parallelisierung

Parameter

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regionen, die verarbeitet werden sollen.

StructElementStructElementStructElementStructElementStructElementstructElement (input_object)  region objectHRegionHRegionHRegionHRegionXHobject

Strukturierendes Element (lageinvariant).

RegionBottomHatRegionBottomHatRegionBottomHatRegionBottomHatRegionBottomHatregionBottomHat (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Ergebnis des Bottom-Hat-Operators.

Beispiel (HDevelop)

read_image (Image,'/images/name.ext')
threshold (Image,Regions,128,255)
gen_circle (Circle,0,0,16)
bottom_hat (Regions,Circle,RegionBottomHat)

Beispiel (C)

threshold(Image,&Regions,128.0,255.0);
gen_circle(&Circle,128.0,128.0,16.0);
bottom_hat(Regions,Circle,&RegionBottomHat);
set_color(WindowHandle,"red");
disp_region(Regions,WindowHandle);
set_color(WindowHandle,"green");
disp_region(RegionBottomHat,WindowHandle);

Beispiel (HDevelop)

read_image (Image,'/images/name.ext')
threshold (Image,Regions,128,255)
gen_circle (Circle,0,0,16)
bottom_hat (Regions,Circle,RegionBottomHat)

Beispiel (C++ (HALCON 5.0-10.0))

#include "HalconCpp.h"

main()
{
  HByteImage    Monkey("monkey");
  HWindow       w;

  HRegion regs = (Monkey >= 128);
  HRegion circ = HRegion::GenCircle (128, 128, 3);

  HRegion rbht = regs.BottomHat (circ);

  Monkey.Display (w);  w.Click ();
  w.SetColor ("red");     regs.Display (w);  w.Click ();
  w.SetColor ("green");   rbht.Display (w);  w.Click ();

  return(0);
}

Beispiel (HDevelop)

read_image (Image,'/images/name.ext')
threshold (Image,Regions,128,255)
gen_circle (Circle,0,0,16)
bottom_hat (Regions,Circle,RegionBottomHat)

Beispiel (HDevelop)

read_image (Image,'/images/name.ext')
threshold (Image,Regions,128,255)
gen_circle (Circle,0,0,16)
bottom_hat (Regions,Circle,RegionBottomHat)

Ergebnis

Bei korrekter Parametrisierung liefert die Funktion bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat den Wert 2 (H_MSG_TRUE). Das Funktionsverhalten für die beiden Fälle leere und keine Eingaberegion lässt sich wie folgt kontrollieren:

Andernfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

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

Nachfolger

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, connectionconnectionConnectionconnectionConnectionConnection

Alternativen

closingclosingClosingclosingClosingClosing, differencedifferenceDifferencedifferenceDifferenceDifference

Siehe auch

top_hattop_hatTopHattop_hatTopHatTopHat, morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat, gray_bothatgray_bothatGrayBothatgray_bothatGrayBothatGrayBothat, openingopeningOpeningopeningOpeningOpening

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren