normalizes the intensity of an image from an optional given input range
to a given output range
- Note
- If optional input range is not provided, image minimum and maximum intensities are used.
On output image, values are given by:
with
and
respectively the input and output ranges specified by the user.
Here is an example of intensity normalization applied to a 8-bits grey level image with
:
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outputRange = PyIPSDK.createRange(50, 200)
outImg = itrans.normalizeImg(inImg, outputRange)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/NormalizeImg/NormalizeImg.h>
Code Example
ImagePtr pAutoOutImg;
if(pInRange.get() != 0) {
pAutoOutImg = normalizeImg(pInImg, pInRange, pOutRange);
itrans::normalizeImg(pInImg, pInRange, pOutRange, pOutImg);
}
else {
pAutoOutImg = normalizeImg(pInImg, pOutRange);
pOutImg = boost::make_shared<MemoryImage>();
pOutImg->init(*pOutputImageGeometry);
normalizeImg(pInImg, pOutRange, pOutImg);
}