IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Laplacian DoG 2dSee full documentation
imagelaplacianDoG2dImg (inImg,inStdDev)
imagelaplacianDoG2dImg (inImg,inStdDev,inOptStdDevFactor,inOptSmoothingGaussianCoverage)

Detailed Description

laplacian algorithm of input 2d image using a difference of gaussian approximation

This image filter computes a blurred approximation of laplacian of an image. This is a band-pass filter which can be used to enhance edges present in an image while reducing noise. A major drawback of this filter is the resulting overall image contrast reduction. It can be combined with a zero crossing detection algorithm to automatically detect edges.

Given a gaussian smoothing operation on an input image $InImg$ using standard deviation $\sigma$ :

\[ G_{\sigma}(InImg[x, y]) = \sum_{o_y=-\dfrac{n_y}{2}}^{\dfrac{n_y}{2}}{\sum_{o_x=-\dfrac{n_x}{2}}^{\dfrac{n_x}{2}}{InImg[x+o_x, y+o_y] \times GaussKnl^{\sigma}_{XY}[o_x, o_y]}} \]

(see Gaussian Smoothing 2d for more informations)

Laplacian with difference of gaussian approximation algorithm defines an excitatory ( $\sigma_E=InStdDev$) and an inhibitory ( $\sigma_I=InStdDev \times InOptStdDevFactor$) standard deviation to compute its output :

\[ OutImg = G_{\sigma_E}(InImg) - G_{\sigma_I}(InImg) \]

Some examples of a laplacian DoG operation applied to an 8-bits grey levels input image are presented in the following.

laplacianDoG2d1.png
laplacianDoG2d2.png
laplacianDoG2d3.png

In these examples we can see that an increase of $InStdDev$ parameter allows to reduce output image noise. This parameter has also an influence on "edge valley width" :

See also
D. Marr, E. Hildreth, 29 Feb 1980, "Theory of Edge Detection", Proceedings of the Royal Society of London. Series B, Biological Sciences, Vol. 207, No. 1167, pp. 187-217.
http://en.wikipedia.org/wiki/Difference_of_Gaussians

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# laplacian difference of gaussian filter 2d computation
outImg = filter.laplacianDoG2dImg(inImg, 1.5)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/LaplacianDoG2dImg/LaplacianDoG2dImg.h>

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute laplacian on input image
ImagePtr pOutImg = laplacianDoG2dImg(pInImg, 3);