HALCON Reference Manual 10.0.2
Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators

derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss (Operator)

Name

derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss — Convolve an image with derivatives of the Gaussian.

Signature

derivate_gauss(Image : DerivGauss : Sigma, Component : )

Herror derivate_gauss(const Hobject Image, Hobject* DerivGauss, double Sigma, const char* Component)

Herror T_derivate_gauss(const Hobject Image, Hobject* DerivGauss, const Htuple Sigma, const Htuple Component)

Herror derivate_gauss(Hobject Image, Hobject* DerivGauss, const HTuple& Sigma, const HTuple& Component)

HImage HImage::DerivateGauss(const HTuple& Sigma, const HTuple& Component) const

HImageArray HImageArray::DerivateGauss(const HTuple& Sigma, const HTuple& Component) const

void HOperatorSetX.DerivateGauss(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*DerivGauss, [in] VARIANT Sigma, [in] VARIANT Component)

IHImageX* HImageX.DerivateGauss(
[in] VARIANT Sigma, [in] BSTR Component)

static void HOperatorSet.DerivateGauss(HObject image, out HObject derivGauss, HTuple sigma, HTuple component)

HImage HImage.DerivateGauss(HTuple sigma, string component)

HImage HImage.DerivateGauss(double sigma, string component)

Description

derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss convolves an image with the derivatives of a Gaussian and calculates various features derived therefrom. SigmaSigmaSigmaSigmasigma is the parameter of the Gaussian (i.e., the amount of smoothing). If one value is passed in SigmaSigmaSigmaSigmasigma the amount of smoothing in the column and row direction is identical. If two values are passed in SigmaSigmaSigmaSigmasigma the first value specifies the amount of smoothing in the column direction, while the second value specifies the amount of smoothing in the row direction. The possible values for ComponentComponentComponentComponentcomponent are:

'none'"none""none""none""none":

Smoothing only.

'x'"x""x""x""x":

First derivative along x.

'y'"y""y""y""y":

First derivative along y.

'gradient'"gradient""gradient""gradient""gradient":

Absolute value of the gradient.

'gradient_dir'"gradient_dir""gradient_dir""gradient_dir""gradient_dir":

Gradient direction in radians.

'xx'"xx""xx""xx""xx":

Second derivative along x.

'yy'"yy""yy""yy""yy":

Second derivative along y.

'xy'"xy""xy""xy""xy":

Second derivative along x and y.

'xxx'"xxx""xxx""xxx""xxx":

Third derivative along x.

'yyy'"yyy""yyy""yyy""yyy":

Third derivative along y.

'xxy'"xxy""xxy""xxy""xxy":

Third derivative along x, x and y.

'xyy'"xyy""xyy""xyy""xyy":

Third derivative along x, y and y.

'det'"det""det""det""det":

Determinant of the Hessian matrix: DET = g_xx * g_yy - g_xy**2

'laplace'"laplace""laplace""laplace""laplace":

Laplace operator (trace of the Hessian matrix): Laplace = g_xx + g_yy

'mean_curvatue'"mean_curvatue""mean_curvatue""mean_curvatue""mean_curvatue":

Mean curvature H

a = (1 + g_x * g_x) * g_yy
b = 2 * g_x * g_y * g_xy
c = (1 + g_y * g_y) * g_xx
d = (1 + g_x * g_x + g_y * g_y) ** (3/2)
H = (a - b + c) / d

'gauss_curvatue'"gauss_curvatue""gauss_curvatue""gauss_curvatue""gauss_curvatue":

Gaussian curvature K

K = DET / (1 + g_x * g_x + g_y * g_y) ** 2

'area'"area""area""area""area":

Differential Area A

  A = E*G - F**2
  E = 1 + g_x**2
  F = g_x * g_y
  G = 1 + g_y**2

'eigenvalue1'"eigenvalue1""eigenvalue1""eigenvalue1""eigenvalue1":

First eigenvalue

a = (g_xx + g_yy) / 2

lambda1 = a + sqrt(a*a - (g_xx * g_yy - g_xy * g_xy))

'eigenvalue2'"eigenvalue2""eigenvalue2""eigenvalue2""eigenvalue2":

Second eigenvalue

a = (g_xx + g_yy) / 2
lambda2 = a - sqrt(a*a - (g_xx * g_yy - g_xy * g_xy))

'eigenvec_dir'"eigenvec_dir""eigenvec_dir""eigenvec_dir""eigenvec_dir":

Direction of the eigenvector corresponding to the first eigenvalue in radians

'kitchen_rosenfeld'"kitchen_rosenfeld""kitchen_rosenfeld""kitchen_rosenfeld""kitchen_rosenfeld":

Second derivative perpendicular to the gradient

k = (g_xx * g_y**2 + g_yy * g_x**2 - 2 * g_xy * g_x * g_y) /
     (g_x**2 + g_y**2)

'zuniga_haralick'"zuniga_haralick""zuniga_haralick""zuniga_haralick""zuniga_haralick":

Normalized second derivative perpendicular to the gradient

k = (g_xx * g_y**2 + g_yy * g_x**2 - 2 * g_xy * g_x * g_y) /
     (g_x**2 + g_y**2)**1.5

'2nd_ddg'"2nd_ddg""2nd_ddg""2nd_ddg""2nd_ddg":

Second derivative along the gradient

k = (g_xx * g_x**2 + 2 * g_y * g_y * g_xy + g_xy * g_y**2) /
     (g_x**2 + g_y**2)

'de_saint_venant'"de_saint_venant""de_saint_venant""de_saint_venant""de_saint_venant":

Second derivative along and perpendicular to the gradient

k = (g_x * g_y * (g_xx - g_yy) - (g_x**2 - g_y**2) * g_xy) /
     (g_x**2 + g_y**2)

Attention

derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss uses a special implementation that is optimized using SSE2 instructions if the system parameter 'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable" is set to 'true'"true""true""true""true" (which is default if SSE2 is available on your machine). This implementation is slightly inaccurate compared to the pure C version due to numerical issues (for 'byte' images and ComponentComponentComponentComponentcomponent 'none'"none""none""none""none", 'x'"x""x""x""x", or 'y'"y""y""y""y" the difference is in order of magnitude of 1.0e-5). If you prefer accuracy over performance you can set 'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable" to 'false'"false""false""false""false" (using set_systemset_systemset_systemSetSystemSetSystem) before you call derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss. This way derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss does not use SSE2 accelerations. Don't forget to set 'sse2_enable'"sse2_enable""sse2_enable""sse2_enable""sse2_enable" back to 'true'"true""true""true""true" afterwards.

derivate_gaussderivate_gaussderivate_gaussDerivateGaussDerivateGauss is only executed on an OpenCL device if SigmaSigmaSigmaSigmasigma induces a filter width respectively height of up to 129 pixels. This corresponds to a SigmaSigmaSigmaSigmasigma of less than 20.7 for ComponentComponentComponentComponentcomponent = 'none'"none""none""none""none". Further as the SSE2 version the OpenCL implementation is slightly inaccurate compared to the pure C version due to numerical issues.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Input images.

DerivGaussDerivGaussDerivGaussDerivGaussderivGauss (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (real)

Filtered result images.

SigmaSigmaSigmaSigmasigma (input_control)  real(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Sigma of the Gaussian.

Default value: 1.0

Suggested values: 0.7, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0

Typical range of values: 0.2 ≤ Sigma Sigma Sigma Sigma sigma ≤ 50.0

Minimum increment: 0.01

Recommended increment: 0.1

Restriction: Sigma > 0.0

ComponentComponentComponentComponentcomponent (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Derivative or feature to be calculated.

Default value: 'x' "x" "x" "x" "x"

List of values: 'none'"none""none""none""none", 'x'"x""x""x""x", 'y'"y""y""y""y", 'gradient'"gradient""gradient""gradient""gradient", 'xx'"xx""xx""xx""xx", 'yy'"yy""yy""yy""yy", 'xy'"xy""xy""xy""xy", 'xxx'"xxx""xxx""xxx""xxx", 'yyy'"yyy""yyy""yyy""yyy", 'xxy'"xxy""xxy""xxy""xxy", 'xyy'"xyy""xyy""xyy""xyy", 'det'"det""det""det""det", 'mean_curvature'"mean_curvature""mean_curvature""mean_curvature""mean_curvature", 'gauss_curvature'"gauss_curvature""gauss_curvature""gauss_curvature""gauss_curvature", 'eigenvalue1'"eigenvalue1""eigenvalue1""eigenvalue1""eigenvalue1", 'eigenvalue2'"eigenvalue2""eigenvalue2""eigenvalue2""eigenvalue2", 'main1_curvature'"main1_curvature""main1_curvature""main1_curvature""main1_curvature", 'main2_curvature'"main2_curvature""main2_curvature""main2_curvature""main2_curvature", 'kitchen_rosenfeld'"kitchen_rosenfeld""kitchen_rosenfeld""kitchen_rosenfeld""kitchen_rosenfeld", 'zuniga_haralick'"zuniga_haralick""zuniga_haralick""zuniga_haralick""zuniga_haralick", '2nd_ddg'"2nd_ddg""2nd_ddg""2nd_ddg""2nd_ddg", 'de_saint_venant'"de_saint_venant""de_saint_venant""de_saint_venant""de_saint_venant", 'area'"area""area""area""area", 'laplace'"laplace""laplace""laplace""laplace", 'gradient_dir'"gradient_dir""gradient_dir""gradient_dir""gradient_dir", 'eigenvec_dir'"eigenvec_dir""eigenvec_dir""eigenvec_dir""eigenvec_dir"

List of values (for compute devices): 'none'"none""none""none""none", 'x'"x""x""x""x", 'y'"y""y""y""y", 'gradient'"gradient""gradient""gradient""gradient", 'gradient_dir'"gradient_dir""gradient_dir""gradient_dir""gradient_dir", 'xx'"xx""xx""xx""xx", 'yy'"yy""yy""yy""yy", 'xy'"xy""xy""xy""xy", 'xxx'"xxx""xxx""xxx""xxx", 'yyy'"yyy""yyy""yyy""yyy", 'xxy'"xxy""xxy""xxy""xxy", 'xyy'"xyy""xyy""xyy""xyy", 'laplace'"laplace""laplace""laplace""laplace"

Example (C)

read_image(&Image,"mreut");
derivate_gauss(Image,&Gauss,3.0,"x");
zero_crossing(Gauss,&ZeroCrossings);

Possible Successors

zero_crossingzero_crossingzero_crossingZeroCrossingZeroCrossing, dual_thresholddual_thresholddual_thresholdDualThresholdDualThreshold

Alternatives

laplacelaplacelaplaceLaplaceLaplace, laplace_of_gausslaplace_of_gausslaplace_of_gaussLaplaceOfGaussLaplaceOfGauss, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, smooth_imagesmooth_imagesmooth_imageSmoothImageSmoothImage, isotropic_diffusionisotropic_diffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusion

See also

zero_crossingzero_crossingzero_crossingZeroCrossingZeroCrossing, dual_thresholddual_thresholddual_thresholdDualThresholdDualThreshold

Module

Foundation


Table of Contents / Filters / Edges ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH