KlassenKlassenKlassenKlassen | | | | Operatoren

dilation_rectangle1dilation_rectangle1DilationRectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 (Operator)

Name

dilation_rectangle1dilation_rectangle1DilationRectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 — Ausführen einer Dilatation mit einem Rechteck.

Signatur

dilation_rectangle1(Region : RegionDilation : Width, Height : )

Herror dilation_rectangle1(const Hobject Region, Hobject* RegionDilation, const Hlong Width, const Hlong Height)

Herror T_dilation_rectangle1(const Hobject Region, Hobject* RegionDilation, const Htuple Width, const Htuple Height)

Herror dilation_rectangle1(Hobject Region, Hobject* RegionDilation, const HTuple& Width, const HTuple& Height)

HRegion HRegion::DilationRectangle1(const HTuple& Width, const HTuple& Height) const

HRegionArray HRegionArray::DilationRectangle1(const HTuple& Width, const HTuple& Height) const

void DilationRectangle1(const HObject& Region, HObject* RegionDilation, const HTuple& Width, const HTuple& Height)

HRegion HRegion::DilationRectangle1(Hlong Width, Hlong Height) const

void HOperatorSetX.DilationRectangle1(
[in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*RegionDilation, [in] VARIANT Width, [in] VARIANT Height)

IHRegionX* HRegionX.DilationRectangle1(
[in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.DilationRectangle1(HObject region, out HObject regionDilation, HTuple width, HTuple height)

HRegion HRegion.DilationRectangle1(int width, int height)

Beschreibung

dilation_rectangle1dilation_rectangle1DilationRectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 führt eine Dilatation auf der/den angegebenen Region(en) RegionRegionRegionRegionRegionregion durch. Das strukturierende Element für diese Operation bildet ein Rechteck mit der Größe WidthWidthWidthWidthWidthwidth x HeightHeightHeightHeightHeightheight. Die Funktion führt zu einer Expansion der Region und zum Schließen von Löchern, die kleiner als das angegebene Rechteck sind, innerhalb der Regionen.

dilation_rectangle1dilation_rectangle1DilationRectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 ist eine sehr schnelle Operation, da die Höhe des Rechtecks nur logarithmisch, die Breite gar nicht in die Komplexita"t eingeht. Dies führt auch bei sehr großen Rechtecken (Kante > 100) zu einem sehr gutem Laufzeitverhalten.

Achtung

dilation_rectangle1dilation_rectangle1DilationRectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 wird für jede Region einzeln angewandt. Sollen Lücken zwischen den Regionen geschlossen werden, dann muss vorher ein union1union1Union1union1Union1Union1 oder union2union2Union2union2Union2Union2 ausgeführt werden.

Damit eine Region in alle Richtungen gleichmäßig vergrößert wird, müssen WidthWidthWidthWidthWidthwidth und HeightHeightHeightHeightHeightheight ungerade sein. Falls das nicht der Fall ist, wird die Region rechts bzw. unten um ein Pixel weiter dilatiert als nach bzw. oben.

Parallelisierung

Parameter

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regionen die verarbeitet werden sollen.

RegionDilationRegionDilationRegionDilationRegionDilationRegionDilationregionDilation (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Ergebnis der Dilation-Operation.

WidthWidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Breite des Rechtecks.

Defaultwert: 11

Wertevorschläge: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201

Typischer Wertebereich: 1 ≤ Width Width Width Width Width width ≤ 511 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

HeightHeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Höhe des Rechtecks.

Defaultwert: 11

Wertevorschläge: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201

Typischer Wertebereich: 1 ≤ Height Height Height Height Height height ≤ 511 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

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_rectangle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = after segmentation " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegionArray regs   = (img >= 220).Connection();
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  dilreg.Display (w);   w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();

  return(0);
}

Beispiel (C)

threshold(Image,&Light,220.0,255.0);
dilation_rectangle1(Light,&Wide,50,50);
set_color(WindowHandle,"red");
disp_region(Wide,WindowHandle);
set_color(WindowHandle,"white");
disp_region(Light,WindowHandle);

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_rectangle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = after segmentation " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegionArray regs   = (img >= 220).Connection();
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  dilreg.Display (w);   w.Click ();
  w.SetColor ("red");   regs.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_rectangle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = after segmentation " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegionArray regs   = (img >= 220).Connection();
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  dilreg.Display (w);   w.Click ();
  w.SetColor ("red");   regs.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_rectangle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = after segmentation " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegionArray regs   = (img >= 220).Connection();
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  dilreg.Display (w);   w.Click ();
  w.SetColor ("red");   regs.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_rectangle ()'" << endl;
  cout << "First = original image " << endl;
  cout << "Blue  = after dilation " << endl;
  cout << "Red   = after segmentation " << endl;

  HByteImage img("monkey");
  HWindow    w;

  HRegionArray regs   = (img >= 220).Connection();
  HRegionArray dilreg = regs.DilationRectangle1 (2, 4);

                        img.Display (w);      w.Click ();
  w.SetColor ("blue");  dilreg.Display (w);   w.Click ();
  w.SetColor ("red");   regs.Display (w);     w.Click ();

  return(0);
}

Komplexität

Sei F1 die Fläche einer Eingaberegion und H die Höhe des Rechtecks, dann ist die Laufzeitkomplexität für eine Region:

Ergebnis

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

Nachfolger

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, connectionconnectionConnectionconnectionConnectionConnection

Alternativen

minkowski_add1minkowski_add1MinkowskiAdd1minkowski_add1MinkowskiAdd1MinkowskiAdd1, minkowski_add2minkowski_add2MinkowskiAdd2minkowski_add2MinkowskiAdd2MinkowskiAdd2, expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion, dilation1dilation1Dilation1dilation1Dilation1Dilation1, dilation2dilation2Dilation2dilation2Dilation2Dilation2, dilation_circledilation_circleDilationCircledilation_circleDilationCircleDilationCircle

Siehe auch

gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren