IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Smart shading correction (white image represented as a paraboloid)

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 More...

IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionResult ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgParaboloidModel, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange)
 wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range More...
 
IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionInfo ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgParaboloidModel, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange, const image::ImagePtr &pOutImg)
 wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range More...
 
IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionResult ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pBlackImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgParaboloidModel, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange)
 wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range More...
 
IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionInfo ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pBlackImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgParaboloidModel, const ipsdk::imaproc::attr::RangeConstPtr &pOutputRange, const image::ImagePtr &pOutImg)
 wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range More...
 

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.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InOptBlackImg [Input Optional] Black image, usually obtained by closing all optical ports of the camera, or by turning off all the light sources. Used by shading correction algorithm X
ipsdk::imaproc::attr::InPIParaboloidParams3d [Input] Plan indexed collection of 3d parameters of paraboloids X
ipsdk::imaproc::attr::InOptOutputRange [Input Optional] expected output image range X
ipsdk::imaproc::attr::OutOffset [Output] Offset. Used for instance by smart shading correction algorithm X
ipsdk::imaproc::attr::OutFactor [Output] Multiplying factor. Used for instance by smart shading correction algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg) && 
ipsdk::processor::ifIsSet (_pInOptBlackImg,
 ipsdk::imaproc::matchSizeAndType (_pInImg,_pInOptBlackImg)) && 
ipsdk::imaproc::matchImagePlans (_pInPIParaboloidParams3d,_pInImg,eImagePlansMatchPolicy::eIPMP_ZCT)

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

Associated library

IPSDKIPLIntensityTransform

Header file

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;
See also
SmartParaboloidShadingCorrection2dImgLvl1

Function Documentation

◆ smartParaboloidShadingCorrection2dImg() [1/4]

IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionResult ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgParaboloidModel,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange 
)

wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure

◆ smartParaboloidShadingCorrection2dImg() [2/4]

IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionInfo ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgParaboloidModel,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange,
const image::ImagePtr pOutImg 
)

wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure

◆ smartParaboloidShadingCorrection2dImg() [3/4]

IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionResult ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pBlackImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgParaboloidModel,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange 
)

wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure

◆ smartParaboloidShadingCorrection2dImg() [4/4]

IPSDKIPLINTENSITYTRANSFORM_API SmartShadingCorrectionInfo ipsdk::imaproc::itrans::smartParaboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pBlackImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgParaboloidModel,
const ipsdk::imaproc::attr::RangeConstPtr pOutputRange,
const image::ImagePtr pOutImg 
)

wrapper function for applies a shading correction to an image, so that output image intensity fits an expected range

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure