IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Smart shading correction (white image represented as a paraboloid)See full documentation
outImg,offset,factorsmartParaboloidShadingCorrection2dImg (inImg,whiteImgParaboloidModel,outputRange)
offset,factorsmartParaboloidShadingCorrection2dImg (inImg,whiteImgParaboloidModel,outputRange,outImg)
outImg,offset,factorsmartParaboloidShadingCorrection2dImg (inImg,blackImg,whiteImgParaboloidModel,outputRange)
offset,factorsmartParaboloidShadingCorrection2dImg (inImg,blackImg,whiteImgParaboloidModel,outputRange,outImg)

Detailed Description

corrects an input image for shading, using an analytic paraboloid model for the white image, and normalize output image so that it fits an expected dynamic range

Given:

the algorithm computes $offset$ and $factor$ described in Shading correction (white image represented as a paraboloid), 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

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# definition of targeted image output range
outputRange = PyIPSDK.createRange(1, 254)
# retrieve white image paraboloid model
paraboloidWhite, bResRead = PyIPSDK.readFromXmlFile(whiteParaboloidPath)
# image shading correction computation
outImg, offset, factor = itrans.smartParaboloidShadingCorrection2dImg(inImg, paraboloidWhite, outputRange)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/SmartParaboloidShadingCorrection2dImg/SmartParaboloidShadingCorrection2dImg.h>

Code Example

// open input image
ImagePtr pInImg = loadTiffImageFile(inPath);
// load white image paraboloid
attr::ParaboloidParams3dPtr pParaboloid = boost::make_shared<attr::ParaboloidParams3d>();
readFromXmlFile(whitePath, *pParaboloid);
// open black image
ImagePtr pBlackImg;
pBlackImg = loadTiffImageFile(blackPath);
RangePtr pRange(boost::make_shared<Range>());
pRange->setValue<Range::Min>(5);
pRange->setValue<Range::Max>(250);
SmartShadingCorrectionResult sscRes = smartParaboloidShadingCorrection2dImg(pInImg, pBlackImg, pParaboloid, pRange);
// retrieve results
ImagePtr pAutoOutImg = sscRes._pOutImg;
ipReal64 offset = sscRes._offset;
ipReal64 factor = sscRes._factor;