image = | shadingCorrectionImg (inImg,whiteImg,factor) |
image = | shadingCorrectionImg (inImg,blackImg,whiteImg,factor) |
image = | shadingCorrectionImg (inImg,whiteImg,offset,factor) |
image = | shadingCorrectionImg (inImg,blackImg,whiteImg,offset,factor) |
corrects an input image for shading
Corrects an input image for shading that may be introduced during its acquisition.
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 scalar offset
- a scalar factor
Values of output image resulting from shading correction are computed as follows:
Here is an example of shading correction applied to a 8-bits grey level image on which an artificial vignetting has been applied:
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans
import PyIPSDK.IPSDKIPLFiltering as filter
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
whiteImg = PyIPSDK.loadTiffImageFile(whiteImgPath)
outImg = itrans.shadingCorrectionImg(inImg, whiteImg, 200)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/ShadingCorrectionImg/ShadingCorrectionImg.h>
Code Example
ImagePtr pAutoOutImg;
if(!pBlackImg)
pAutoOutImg = shadingCorrectionImg(pInImg, pWhiteImg, factor);
else
pAutoOutImg = shadingCorrectionImg(pInImg, pBlackImg, pWhiteImg, factor);