outImg,offset,factor = | smartShadingCorrectionImg (inImg,whiteImg,outputRange) |
offset,factor = | smartShadingCorrectionImg (inImg,whiteImg,outputRange,outImg) |
outImg,offset,factor = | smartShadingCorrectionImg (inImg,blackImg,whiteImg,outputRange) |
offset,factor = | smartShadingCorrectionImg (inImg,blackImg,whiteImg,outputRange,outImg) |
corrects an input image for shading, and normalize output image so that it fits an expected dynamic range
Given:
- an input image

- a white and an optional black image,
and
, whose dimensions and data types are identical to input image dimensions and data types,
- a dynamic range expected for output image
the algorithm computes
and
described in shading correction algorithm, so that output image resulting from shading correction fits in the dynamic range specified by the user.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans
import PyIPSDK.IPSDKIPLFiltering as filter
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outputRange = PyIPSDK.createRange(0, 255)
whiteImg = PyIPSDK.loadTiffImageFile(whiteImgPath)
outImg, offset, factor = itrans.smartShadingCorrectionImg(inImg, whiteImg, outputRange)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/SmartShadingCorrectionImg/SmartShadingCorrectionImg.h>
Code Example
SmartShadingCorrectionResult sscRes;
if(!pBlackImg)
sscRes = smartShadingCorrectionImg(pInImg, pWhiteImg, pRange);
else
sscRes = smartShadingCorrectionImg(pInImg, pBlackImg, pWhiteImg, pRange);
ImagePtr pAutoOutImg = sscRes._pOutImg;
ipReal64 offset = sscRes._offset;
ipReal64 factor = sscRes._factor;