derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss (Operator)

Name

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

void DerivateGauss(const HObject& Image, HObject* DerivGauss, const HTuple& Sigma, const HTuple& Component)

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

HImage HImage::DerivateGauss(double Sigma, const HString& Component) const

HImage HImage::DerivateGauss(double Sigma, const char* Component) const

HImage HImage::DerivateGauss(double Sigma, const wchar_t* Component) const   ( Windows only)

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)

def derivate_gauss(image: HObject, sigma: MaybeSequence[float], component: str) -> HObject

Description

derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss 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:

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

Laplace operator (trace of the Hessian matrix):

'mean_curvature'"mean_curvature""mean_curvature""mean_curvature""mean_curvature":

Mean curvature H

'gauss_curvature'"gauss_curvature""gauss_curvature""gauss_curvature""gauss_curvature":

Gaussian curvature K

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

Differential Area A

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

First eigenvalue

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

Second eigenvalue

'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

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

Normalized second derivative perpendicular to the gradient

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

Second derivative along the gradient

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

Second derivative along and perpendicular to the gradient

Attention

Besides the pure C version there are specific implementations of derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss for speed up. Such an optimization is applied in case it is supported by the system and the respective system parameter *_enable is set to 'true'"true""true""true""true", see set_systemset_systemSetSystemSetSystemset_system. The following optimizations are supported (listed according to their priority):

These implementations are slightly inaccurate compared to the pure C version due to numerical issues. For example, using SSE2 instructions the inaccuracy is in order of magnitude of 1.0e-5 for 'byte' images and ComponentComponentComponentcomponentcomponent set to 'none'"none""none""none""none", 'x'"x""x""x""x", or 'y'"y""y""y""y".

In case accuracy is preferred over performance, set all corresponding system parameter to 'false'"false""false""false""false" (using set_systemset_systemSetSystemSetSystemset_system) before calling derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss. This way derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss does not use the accelerations. Do not forget to set the parameter back to 'true'"true""true""true""true" afterwards.

derivate_gaussderivate_gaussDerivateGaussDerivateGaussderivate_gauss 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". The OpenCL implementation is slightly inaccurate compared to the pure C version due to numerical issues.

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution Information

Parameters

ImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / real*) *allowed for compute devices

Input images.

DerivGaussDerivGaussDerivGaussderivGaussderiv_gauss (output_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject * (real)

Filtered result images.

SigmaSigmaSigmasigmasigma (input_control)  real(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Sigma of the Gaussian.

Default: 1.0

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

Value range: 0.01 ≤ Sigma Sigma Sigma sigma sigma ≤ 50.0

Minimum increment: 0.01

Recommended increment: 0.1

ComponentComponentComponentcomponentcomponent (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Derivative or feature to be calculated.

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

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

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_crossingZeroCrossingZeroCrossingzero_crossing, dual_thresholddual_thresholdDualThresholdDualThresholddual_threshold

Alternatives

laplacelaplaceLaplaceLaplacelaplace, laplace_of_gausslaplace_of_gaussLaplaceOfGaussLaplaceOfGausslaplace_of_gauss, binomial_filterbinomial_filterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFiltergauss_filter, smooth_imagesmooth_imageSmoothImageSmoothImagesmooth_image, isotropic_diffusionisotropic_diffusionIsotropicDiffusionIsotropicDiffusionisotropic_diffusion

See also

zero_crossingzero_crossingZeroCrossingZeroCrossingzero_crossing, dual_thresholddual_thresholdDualThresholdDualThresholddual_threshold

Module

Foundation