IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

normalizes the intensity of an image with a sigmoid More...

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::sigmoidNormalizeImg (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::ipReal64 alpha, const ipsdk::ipReal64 beta, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange)
 wrapper function for Normalize the intensity of an image with a sigmoid More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::sigmoidNormalizeImg (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::ipReal64 alpha, const ipsdk::ipReal64 beta, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange, const ipsdk::image::ImagePtr &pOutImg)
 wrapper function for Normalize the intensity of an image with a sigmoid More...
 

Detailed Description

normalizes the intensity of an image with a sigmoid

On output image, values are given by:

\[ OutImg[i] = outMin + (outMax-outMin) \times \frac{1}{1 + e^{- \frac{InImg[i]-\beta}{\alpha}}} \]

with

Here is an example of intensity normalization applied to Lena grey level image with $ \alpha $=20, $ \beta $=20 and $OutRange$ = [3, 247]:

sigmoidNormalizeImg.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InSigmoidAlpha [Input] alpha parameter of image sigmoid normalization algorithm X
ipsdk::imaproc::attr::InSigmoidBeta [Input] beta parameter of image sigmoid normalization algorithm X
ipsdk::imaproc::attr::InOutputRange [Input] output image intensity range for algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg) && (ipsdk::imaproc::matchImageRange<ipsdk::imaproc::attr::Range::Min>(_pOutImg,_pInOutputRange) && ipsdk::imaproc::matchImageRange<ipsdk::imaproc::attr::Range::Max>(_pOutImg,_pInOutputRange))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# definition of targeted image output range
outputRange = PyIPSDK.createRange(3, 247)
# definition of alpha and beta input parameters
alpha = 20
beta = 128
# image normalization computation
autoOutImg = itrans.sigmoidNormalizeImg(inImg, alpha, beta, outputRange)

Example of C++ code :

Example informations

Associated library

IPSDKIPLIntensityTransform

Header file

Code Example

ImagePtr pInImg = loadTiffImageFile(inputImgFilePath);
const ipsdk::ipReal64 alpha = 20.0;
const ipsdk::ipReal64 beta = 128.0;
ImagePtr pAutoOutImg = sigmoidNormalizeImg(pInImg, alpha, beta, attr::createRange(3, 247));
See also
SigmoidNormalizeImgLvl1
SigmoidNormalizeImgLvl2
SigmoidNormalizeImgLvl3

Function Documentation

◆ sigmoidNormalizeImg() [1/2]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::sigmoidNormalizeImg ( const ipsdk::image::ImageConstPtr pInImg,
const ipsdk::ipReal64  alpha,
const ipsdk::ipReal64  beta,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange 
)

wrapper function for Normalize the intensity of an image with a sigmoid

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sigmoidNormalizeImg() [2/2]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::sigmoidNormalizeImg ( const ipsdk::image::ImageConstPtr pInImg,
const ipsdk::ipReal64  alpha,
const ipsdk::ipReal64  beta,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange,
const ipsdk::image::ImagePtr pOutImg 
)

wrapper function for Normalize the intensity of an image with a sigmoid

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure