KlassenKlassenKlassenKlassen | | | | Operatoren

zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix (Operator)

Name

zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix — Subpixel-genaues Extrahieren von Nulldurchgängen in einem Bild

Signatur

zero_crossing_sub_pix(Image : ZeroCrossings : : )

Herror zero_crossing_sub_pix(const Hobject Image, Hobject* ZeroCrossings)

Herror T_zero_crossing_sub_pix(const Hobject Image, Hobject* ZeroCrossings)

Herror zero_crossing_sub_pix(Hobject Image, Hobject* ZeroCrossings)

HXLDContArray HImage::ZeroCrossingSubPix() const

void ZeroCrossingSubPix(const HObject& Image, HObject* ZeroCrossings)

HXLDCont HImage::ZeroCrossingSubPix() const

void HOperatorSetX.ZeroCrossingSubPix(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ZeroCrossings)

IHXLDContX* HImageX.ZeroCrossingSubPix()

static void HOperatorSet.ZeroCrossingSubPix(HObject image, out HObject zeroCrossings)

HXLDCont HImage.ZeroCrossingSubPix()

Beschreibung

zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix extrahiert die Nulldurchgänge des Eingabebildes ImageImageImageImageImageimage subpixel-genau. Die extrahierten Nulldurchgänge werden als XLD-Konturen in ZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingszeroCrossings zurückgegeben. zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix kann somit zur subpixel-genauen Kantenextraktion verwendet werden, wenn als Eingabebild ein Laplace-gefiltertes Bild übergeben wird (siehe laplacelaplaceLaplacelaplaceLaplaceLaplace, laplace_of_gausslaplace_of_gaussLaplaceOfGausslaplace_of_gaussLaplaceOfGaussLaplaceOfGauss, derivate_gaussderivate_gaussDerivateGaussderivate_gaussDerivateGaussDerivateGauss).

Bei der Extraktion wird das Eingabebild als Oberfläche interpretiert, wobei zwischen den Pixelmittelpunkten bilinear interpoliert wird. Konsistent mit der so entstehenden Oberfläche werden einzelne Nulldurchgangslinien für jedes Pixel extrahiert und zu topologisch „sauberen“ Konturen verknüpft. Das bedeutet, dass die Nulldurchgangskonturen an Kreuzungspunkten sauber aufgetrennt werden. Falls im Bild flächenhafte Bereiche mit einem konstanten Grauwert von 0 auftreten, wird nur der Rand solcher Gebiete als Nulldurchgang zurückgeliefert.

Parallelisierung

Parameter

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (int1 / int2 / int4 / real)

Eingabebild.

ZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingszeroCrossings (output_object)  xld_cont-array objectHXLDContHXLDContHXLDContArrayHXLDContXHobject *

Extrahierte Nulldurchgänge.

Beispiel (HDevelop)

* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)

* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)

Beispiel (C)

/* Detection zero crossings of the Laplacian-of-Gaussian of aerial image */
read_image(&Image,"mreut");
derivate_gauss(Image,&Laplace,3,"laplace");
zero_crossing_sub_pix(Laplace,&ZeroCrossings);
disp_xld(ZeroCrossings,WindowHandle);

/* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
   that have a large gradient magnitude, in an aerial image */
read_image(&Image,"mreut");
Sigma = 1.5;
/* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
   calculates a Gaussian-smoothed gradient, in which the edge amplitudes
   are too small because of the Gaussian smoothing, to correspond to a true
   edge amplitude of 20. */
Threshold = 20/(Sigma*sqrt(2*PI));
derivate_gauss(Image,&Gradient,Sigma,"gradient");
threshold(Gradient,&Region,Threshold,255);
reduce_domain(Image,Region,&ImageReduced);
derivate_gauss(ImageReduced,&Laplace,Sigma,"laplace");
zero_crossing_sub_pix(Laplace,&Edges);
disp_xld(Edges,WindowHandle);

Beispiel (HDevelop)

* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)

* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)

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

/* Detection zero crossings of the Laplacian-of-Gaussian of aerial image */
HWindow Window(0,0,512,512);
HImage Image("mreut");
HImage Laplace = Image.DerivateGauss(3,"laplace");
HXLDContArray ZeroCrossings = Laplace.ZeroCrossingsSubPix();
ZeroCrossings.Display(Window);

/* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
   that have a large gradient magnitude, in an aerial image */
HWindow Window(0,0,512,512);
HImage Image("mreut");
Sigma = 1.5;
/* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
   calculates a Gaussian-smoothed gradient, in which the edge amplitudes
   are too small because of the Gaussian smoothing, to correspond to a true
   edge amplitude of 20. */
Threshold = 20/(Sigma*sqrt(2*PI));
HImage Gradient = Image.DerivateGauss(Sigma,"gradient");
HRegion Region = Gradient.Threshold(Threshold,255);
HImage ImageReduced = Image.ReduceDomain(Region);
HImage Laplace = ImageReduced.DerivateGauss(Sigma,"laplace");
HXLDContArray Edges = Laplace.ZeroCrossingSubPix();
Edges.Display(Window);

Beispiel (HDevelop)

* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)

* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)

Beispiel (HDevelop)

* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)

* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)

Ergebnis

zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPix liefert normalerweise den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

laplacelaplaceLaplacelaplaceLaplaceLaplace, laplace_of_gausslaplace_of_gaussLaplaceOfGausslaplace_of_gaussLaplaceOfGaussLaplaceOfGauss, diff_of_gaussdiff_of_gaussDiffOfGaussdiff_of_gaussDiffOfGaussDiffOfGauss, derivate_gaussderivate_gaussDerivateGaussderivate_gaussDerivateGaussDerivateGauss

Alternativen

zero_crossingzero_crossingZeroCrossingzero_crossingZeroCrossingZeroCrossing

Siehe auch

threshold_sub_pixthreshold_sub_pixThresholdSubPixthreshold_sub_pixThresholdSubPixThresholdSubPix

Modul

2D Metrology


KlassenKlassenKlassenKlassen | | | | Operatoren