IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Compute X, Y and Z gradients of an input image convolving it with 3d Sobel kernels. More...

IPSDKIPLFILTERING_API GradientXYZImg ipsdk::imaproc::filter::sobelGradient3dImg (const image::ImageConstPtr &pInImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API GradientXYZImg ipsdk::imaproc::filter::sobelGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize, const image::ImagePtr &pOutOptGradXImg, const image::ImagePtr &pOutOptGradYImg, const image::ImagePtr &pOutOptGradZImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelXGradient3dImg (const image::ImageConstPtr &pInImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelXGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelXGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize, const image::ImagePtr &pOutXGradImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelYGradient3dImg (const image::ImageConstPtr &pInImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelYGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelYGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize, const image::ImagePtr &pOutYGradImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelZGradient3dImg (const image::ImageConstPtr &pInImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelZGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelZGradient3dImg (const image::ImageConstPtr &pInImg, const ipsdk::eSobelKernelType &kernelType, const bool bNormalize, const image::ImagePtr &pOutYGradImg)
 wrapper function for Sobel filter used to compute gradient on a 2d image More...
 

Detailed Description

Compute X, Y and Z gradients of an input image convolving it with 3d Sobel kernels.

3d Sobel kernels are separable, they can be decomposed as the product of 3 vectors. X gradient kernel equals to the product $V_{smoothing}*V_{smoothing}*V_{deriv}$, Y gradient kernel equals to the product $V_{smoothing}*V_{deriv}*V_{smoothing}$, and Z gradient kernel equals to the product $V_{deriv}*V_{smoothing}*V_{smoothing}$. Depending on the value of parameter $InOptSobelKernelType$ (default value: eSKT_SobelHalfKnlSz1), smoothing and derivative vectors equal to:

To handle image borders, a mirror extrapolation is used (see Border policy for more details).

Here is an example of a Sobel gradient applied to an 8-bits grey levels input image with default parameters used:

sobelGradient3d.png
See also
https://en.wikipedia.org/wiki/Sobel_operator

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InOptSobelKernelType [Input Optional] kernel type for Sobel gradient filter X
ipsdk::imaproc::attr::InOptNormalizeSobelKernel [Input Optional] boolean flag indicating whether kernel use for Sobel gradient filtering has to be normalized or not X
ipsdk::imaproc::attr::OutOptGradXImg3d [Output Optional] 3d image associated to X component of gradient computation promoteUnary (_pOutOptGradXImg3d, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutOptGradYImg3d [Output Optional] 3d image associated to Y component of gradient computation promoteUnary (_pOutOptGradYImg3d, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutOptGradZImg3d [Output Optional] 3d image associated to Z component of gradient computation promoteUnary (_pOutOptGradZImg3d, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)

Global Rule description

Global rule description for algorithm :
((ipsdk::processor::isSet (_pOutOptGradXImg3d) || 
  ipsdk::processor::isSet (_pOutOptGradYImg3d) || 
  ipsdk::processor::isSet (_pOutOptGradZImg3d)) && 
 (ipsdk::processor::ifIsSet (_pOutOptGradXImg3d,
   ipsdk::imaproc::matchSize (_pInImg3d,_pOutOptGradXImg3d))) && 
 (ipsdk::processor::ifIsSet (_pOutOptGradYImg3d,
   ipsdk::imaproc::matchSize (_pInImg3d,_pOutOptGradYImg3d))) && 
 (ipsdk::processor::ifIsSet (_pOutOptGradZImg3d,
   ipsdk::imaproc::matchSize (_pInImg3d,_pOutOptGradZImg3d))))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Sobel gradient filter 3d computation
outGxImg, outGyImg, outGzImg = filter.sobelGradient3dImg(inImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// opening input 3D image from TIFF file
ImagePtr pInImg = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
// applying Sobel gradient to input image
GradientXYZImg gradientXYZ = sobelGradient3dImg(pInImg);
See also
SobelGradient3dImgLvl1

Function Documentation

◆ sobelGradient3dImg() [1/3]

IPSDKIPLFILTERING_API GradientXYZImg ipsdk::imaproc::filter::sobelGradient3dImg ( const image::ImageConstPtr pInImg)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelGradient3dImg() [2/3]

IPSDKIPLFILTERING_API GradientXYZImg ipsdk::imaproc::filter::sobelGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelGradient3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize,
const image::ImagePtr pOutOptGradXImg,
const image::ImagePtr pOutOptGradYImg,
const image::ImagePtr pOutOptGradZImg 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelXGradient3dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelXGradient3dImg ( const image::ImageConstPtr pInImg)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelXGradient3dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelXGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelXGradient3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelXGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize,
const image::ImagePtr pOutXGradImg 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelYGradient3dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelYGradient3dImg ( const image::ImageConstPtr pInImg)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelYGradient3dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelYGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelYGradient3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelYGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize,
const image::ImagePtr pOutYGradImg 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelZGradient3dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelZGradient3dImg ( const image::ImageConstPtr pInImg)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelZGradient3dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::sobelZGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sobelZGradient3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::sobelZGradient3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::eSobelKernelType kernelType,
const bool  bNormalize,
const image::ImagePtr pOutYGradImg 
)

wrapper function for Sobel filter used to compute gradient on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure