KlassenKlassenKlassenKlassen | | | | Operatoren

morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat (Operator)

Name

morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat — Vereinigen von bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat und top_hattop_hatTopHattop_hatTopHatTopHat.

Warnung

morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat ist veraltet und wird nur aus Gründen der Rückwärtskompatibilität zur Verfügung gestellt.

Signatur

morph_hat(Region, StructElement : RegionMorphHat : : )

Herror morph_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionMorphHat)

Herror T_morph_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionMorphHat)

Herror morph_hat(Hobject Region, Hobject StructElement, Hobject* RegionMorphHat)

HRegion HRegion::MorphHat(const HRegion& StructElement) const

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

void MorphHat(const HObject& Region, const HObject& StructElement, HObject* RegionMorphHat)

HRegion HRegion::MorphHat(const HRegion& StructElement) const

void HOperatorSetX.MorphHat(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* StructElement, [out] IHUntypedObjectX*RegionMorphHat)

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

static void HOperatorSet.MorphHat(HObject region, HObject structElement, out HObject regionMorphHat)

HRegion HRegion.MorphHat(HRegion structElement)

Beschreibung

morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat vereinigt die Flächen, die bei der openingopeningOpeningopeningOpeningOpening-Operation wegfallen mit den Flächen, die bei der closingclosingClosingclosingClosingClosing-Operation hinzukommen. Dies entspricht also der Vereinigung von top_hattop_hatTopHattop_hatTopHatTopHat und bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat. Die Position von StructElementStructElementStructElementStructElementStructElementstructElement ist ohne Bedeutung.

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.

Achtung

Die Regionen werden einzeln bearbeitet.

Parallelisierung

Parameter

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regionen, die verarbeitet werden sollen.

StructElementStructElementStructElementStructElementStructElementstructElement (input_object)  region objectHRegionHRegionHRegionHRegionXHobject

Strukturierendes Element (lageinvariant).

RegionMorphHatRegionMorphHatRegionMorphHatRegionMorphHatRegionMorphHatregionMorphHat (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Vereinigung von Top-Hat und Bottom-Hat.

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

#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_circle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Red   = after segmentation " << endl;
  cout << "Blue  = after erosion " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegion      circ   = HRegion::GenCircle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray tophat = regs.TopHat (circ);
  HRegionArray bothat = regs.BottomHat (circ);
  HRegionArray unionX = tophat.Union2 (bothat);

                        img.Display (w);      w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();
  w.SetColor ("blue");  tophat.Display (w);   w.Click ();
  w.SetColor ("green"); bothat.Display (w);   w.Click ();
  w.SetColor ("white"); unionX.Display (w);   w.Click ();

  return(0);
}

Beispiel (C)

my_morph_hat(Hobject *In, Hobject StructElement, Hobject *Out)
{
  Hobject top, bottom;
  top_hat(In,StructElement,&top);
  bottom_hat(In,StructElement,&bottom);
  union2(top,bottom,Out);
  clear_obj(top); clear_obj(bottom);
}

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

#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_circle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Red   = after segmentation " << endl;
  cout << "Blue  = after erosion " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegion      circ   = HRegion::GenCircle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray tophat = regs.TopHat (circ);
  HRegionArray bothat = regs.BottomHat (circ);
  HRegionArray unionX = tophat.Union2 (bothat);

                        img.Display (w);      w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();
  w.SetColor ("blue");  tophat.Display (w);   w.Click ();
  w.SetColor ("green"); bothat.Display (w);   w.Click ();
  w.SetColor ("white"); unionX.Display (w);   w.Click ();

  return(0);
}

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

#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_circle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Red   = after segmentation " << endl;
  cout << "Blue  = after erosion " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegion      circ   = HRegion::GenCircle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray tophat = regs.TopHat (circ);
  HRegionArray bothat = regs.BottomHat (circ);
  HRegionArray unionX = tophat.Union2 (bothat);

                        img.Display (w);      w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();
  w.SetColor ("blue");  tophat.Display (w);   w.Click ();
  w.SetColor ("green"); bothat.Display (w);   w.Click ();
  w.SetColor ("white"); unionX.Display (w);   w.Click ();

  return(0);
}

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

#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_circle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Red   = after segmentation " << endl;
  cout << "Blue  = after erosion " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegion      circ   = HRegion::GenCircle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray tophat = regs.TopHat (circ);
  HRegionArray bothat = regs.BottomHat (circ);
  HRegionArray unionX = tophat.Union2 (bothat);

                        img.Display (w);      w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();
  w.SetColor ("blue");  tophat.Display (w);   w.Click ();
  w.SetColor ("green"); bothat.Display (w);   w.Click ();
  w.SetColor ("white"); unionX.Display (w);   w.Click ();

  return(0);
}

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

#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"

main()
{
  cout << "Reproduction of 'dilation_circle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Red   = after segmentation " << endl;
  cout << "Blue  = after erosion " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegion      circ   = HRegion::GenCircle (10, 10, 1.5);
  HRegionArray regs   = (img >= 128).Connection();
  HRegionArray tophat = regs.TopHat (circ);
  HRegionArray bothat = regs.BottomHat (circ);
  HRegionArray unionX = tophat.Union2 (bothat);

                        img.Display (w);      w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();
  w.SetColor ("blue");  tophat.Display (w);   w.Click ();
  w.SetColor ("green"); bothat.Display (w);   w.Click ();
  w.SetColor ("white"); unionX.Display (w);   w.Click ();

  return(0);
}

Ergebnis

Bei korrekter Parametrisierung liefert die Funktion morph_hatmorph_hatMorphHatmorph_hatMorphHatMorphHat 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_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled

Nachfolger

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, connectionconnectionConnectionconnectionConnectionConnection

Alternativen

top_hattop_hatTopHattop_hatTopHatTopHat, bottom_hatbottom_hatBottomHatbottom_hatBottomHatBottomHat, union2union2Union2union2Union2Union2

Siehe auch

openingopeningOpeningopeningOpeningOpening, closingclosingClosingclosingClosingClosing

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren