IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::laplacianDoG2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev)
 wrapper function for laplacian algorithm of input 2d image using a difference of gaussian approximation More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::laplacianDoG2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal32 inOptStdDevFactor, const attr::GaussianCoverageConstPtr &pInOptSmoothingGaussianCoverage)
 wrapper function for laplacian algorithm of input 2d image using a difference of gaussian approximation More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::laplacianDoG2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal32 inOptStdDevFactor, const attr::GaussianCoverageConstPtr &pInOptSmoothingGaussianCoverage, const image::ImagePtr &pOutImg)
 wrapper function for laplacian algorithm of input 2d image using a difference of gaussian approximation More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InStdDev [Input] standard deviation used for operation along all axis X
ipsdk::imaproc::attr::InOptStdDevFactor [Input Optional] factor applied on standard deviation for laplacian difference of gaussian computation X
ipsdk::imaproc::attr::InOptSmoothingGaussianCoverage [Input Optional] Parameter allowing to specify a gaussian distribution coverage for processing X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::promoteUnary (_pOutImg, _pInImg, ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutWk1Img [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1Img, _pInImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg) && 
ipsdk::imaproc::matchSizeAndType (_pInImg,_pOutWk1Img) && 
ipsdk::imaproc::noInSitu (_pInImg,_pOutWk1Img) && 
ipsdk::imaproc::noInSitu (_pOutImg,_pOutWk1Img)

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

Associated library

IPSDKIPLFiltering

Header file

Code Example

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

Function Documentation

◆ laplacianDoG2dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::laplacianDoG2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev 
)

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ laplacianDoG2dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::laplacianDoG2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal32  inOptStdDevFactor,
const attr::GaussianCoverageConstPtr pInOptSmoothingGaussianCoverage 
)

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ laplacianDoG2dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::laplacianDoG2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal32  inOptStdDevFactor,
const attr::GaussianCoverageConstPtr pInOptSmoothingGaussianCoverage,
const image::ImagePtr pOutImg 
)

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure