bottom_hatbottom_hatBottomHatBottomHatbottom_hat (Operator)

Name

bottom_hatbottom_hatBottomHatBottomHatbottom_hat — 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)

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

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

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

HRegion HRegion.BottomHat(HRegion structElement)

def bottom_hat(region: HObject, struct_element: HObject) -> HObject

Beschreibung

bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat berechnet die Bottom-Hat-Operation, indem zunächst eine Closing-Operation mit StructElementStructElementStructElementStructElementstructElementstruct_element (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_hatBottomHatBottomHatBottomHatbottom_hat die Region, welche für diesen Zusammenschluss notwendig ist.

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

Das strukturierende Element (StructElementStructElementStructElementStructElementstructElementstruct_element) kann mit Operatoren wie gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, etc. erzeugt werden.

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregionregion (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regionen, die verarbeitet werden sollen.

StructElementStructElementStructElementStructElementstructElementstruct_element (input_object)  region objectHRegionHObjectHRegionHobject

Strukturierendes Element (lageinvariant).

RegionBottomHatRegionBottomHatRegionBottomHatRegionBottomHatregionBottomHatregion_bottom_hat (output_object)  region(-array) objectHRegionHObjectHRegionHobject *

Ergebnis des Bottom-Hat-Operators.

Beispiel (HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
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 (C++)

#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, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

Beispiel (HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

Ergebnis

Bei korrekter Parametrisierung liefert die Funktion bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat 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_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm, gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled

Nachfolger

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, connectionconnectionConnectionConnectionConnectionconnection

Alternativen

closingclosingClosingClosingClosingclosing, differencedifferenceDifferenceDifferenceDifferencedifference

Siehe auch

top_hattop_hatTopHatTopHatTopHattop_hat, gray_bothatgray_bothatGrayBothatGrayBothatGrayBothatgray_bothat, openingopeningOpeningOpeningOpeningopening

Modul

Foundation