image = | paraboloidShadingCorrection2dImg (inImg,whiteImgModel,factor) |
image = | paraboloidShadingCorrection2dImg (inImg,whiteImgModel,offset,factor) |
image = | paraboloidShadingCorrection2dImg (inImg,blackImg,whiteImgModel,offset,factor) |
corrects an input image for shading, using an analytic paraboloid model for the white image
Corrects an input image for shading that may be introduced during its acquisition, using an analytic paraboloid model for the white image.
Given:
- an input image

- the parameters of the analytic equation of a paraboloid for the white image
- an optional black image,
, 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:
with:
- i = (x, y, ...)
![$ WhiteImg[x, y, ...] = X2Coef*x^2 + Y2Coef*y^2 + XYCoef*x*y + XCoef*x + YCoef*y + Constant $](form_894.png)
parameters are specified by the user through the ParaboloidParams3d data item; these parameters can be computed through the use of Paraboloid Image Fitting 2d algorithm
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)
paraboloidWhite, bResRead = PyIPSDK.readFromXmlFile(whiteParaboloidPath)
outImg = itrans.paraboloidShadingCorrection2dImg(inImg, paraboloidWhite, 5.025, 254.02)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/ParaboloidShadingCorrection2dImg/ParaboloidShadingCorrection2dImg.h>
Code Example
readFromXmlFile(whitePath, *pParaboloid);
ImagePtr pBlackImg;
const ipReal64 offset = .0;
const ipReal64 factor = 255.0;
ImagePtr pAutoOutImg = paraboloidShadingCorrection2dImg(pInImg, pBlackImg, pParaboloid, offset, factor);