Skip to content

diff_of_gaussDiffOfGaussDiffOfGaussdiff_of_gaussdiff_of_gauss🔗

Short description🔗

diff_of_gaussDiffOfGaussDiffOfGaussdiff_of_gaussdiff_of_gauss — Approximate the LoG operator (Laplace of Gaussian).

Signature🔗

diff_of_gauss( image Image, out image DiffOfGauss, real Sigma, real SigFactor )void DiffOfGauss( const HObject& Image, HObject* DiffOfGauss, const HTuple& Sigma, const HTuple& SigFactor )static void HOperatorSet.DiffOfGauss( HObject image, out HObject diffOfGauss, HTuple sigma, HTuple sigFactor )def diff_of_gauss( image: HObject, sigma: float, sig_factor: float ) -> HObject

Herror diff_of_gauss( const Hobject Image, Hobject* DiffOfGauss, double Sigma, double SigFactor )

Herror T_diff_of_gauss( const Hobject Image, Hobject* DiffOfGauss, const Htuple Sigma, const Htuple SigFactor )

HImage HImage::DiffOfGauss( double Sigma, double SigFactor ) const

HImage HImage.DiffOfGauss( double sigma, double sigFactor )

Description🔗

diff_of_gaussDiffOfGauss approximates the Laplace-of-Gauss operator by a difference of Gaussians. The standard deviations of these Gaussians can be calculated, according to Marr, from the Parameter Sigmasigmasigma of the LoG and the ratio of the two standard deviations (SigFactorsigFactorsig_factor) as:

\[\begin{eqnarray*} sigma1 &=& \frac{\textrm{Sigma}}{ \sqrt{ -2 \frac{ \log {(\frac{1}{SigFactor})}} { \textrm{SigFactor} ^2 - 1} } } \\ sigma2 &=& \frac{sigma1}{\textrm{SigFactor}}\\ \textrm{DiffOfGauss} &=& \textrm{Image} * gauss(sigma1) - \textrm{Image} * gauss(sigma2) \end{eqnarray*}\]

For a \(\textrm{SigFactor} = 1.6\), according to Marr, an approximation to the Mexican-Hat-Operator results. The resulting image is stored in DiffOfGaussdiffOfGaussdiff_of_gauss.

Attention🔗

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🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

  • Automatically parallelized on domain level.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image

DiffOfGaussdiffOfGaussdiff_of_gauss (output_object) (multichannel-)image(-array) → object (int2)HObject (int2)HImage (int2)HObject (int2)Hobject * (int2)

LoG image.

Sigmasigmasigma (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Smoothing parameter of the Laplace operator to approximate.

Default: 3.03.0
Suggested values: 2.0, 3.0, 4.0, 5.02.0, 3.0, 4.0, 5.0
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Sigma > 0.0

SigFactorsigFactorsig_factor (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Ratio of the standard deviations used (Marr recommends 1.6).

Default: 1.61.6
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: SigFactor > 0.0

Example🔗

(HDevelop)

read_image(Image,'fabrik')
diff_of_gauss(Image,Laplace,2.0,1.6)
zero_crossing(Laplace,ZeroCrossings)
(C)
read_image(&Image,"mreut")\;
diff_of_gauss(Image,&Laplace,2.0,1.6)\;
zero_crossing(Laplace,&ZeroCrossings)\;

Complexity🔗

The execution time depends linearly on the number of pixels and the size of sigma.

Result🔗

diff_of_gaussDiffOfGauss returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

zero_crossingZeroCrossing, dual_thresholdDualThreshold

Alternatives

laplaceLaplace, derivate_gaussDerivateGauss

References🔗

D. Marr: ``Vision (A computational investigation into human representation and processing of visual information)’‘; New York, W.H. Freeman and Company; 1982.

Module🔗

Foundation