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

corrects an input image for shading, using an analytic paraboloid model for the white image More...

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 factor)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 factor, const ipsdk::image::ImagePtr &pOutImg)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 
IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 offset, const ipReal64 factor)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 offset, const ipReal64 factor, const ipsdk::image::ImagePtr &pOutImg)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 
IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pBlackImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 offset, const ipReal64 factor)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pBlackImg, const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr &pWhiteImgModel, const ipReal64 offset, const ipReal64 factor, const ipsdk::image::ImagePtr &pOutImg)
 wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image More...
 

Detailed Description

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:

Values of output image resulting from shading correction are computed as follows:

\[ OutImg[i] = \begin{cases} offset + factor.{\dfrac {InImg[i]-BlackImg[i]} {WhiteImg[i]-BlackImg[i]}} & \text { if } WhiteImg[i]-BlackImg[i] \ne 0 \\ offset & \text { otherwise} \end{cases} \]

with:

Here is an example of shading correction applied to a 8-bits grey level image on which an artificial vignetting has been applied:

paraboloidShadingCorrection2dImg.png

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::InOptOffset [Input Optional] Offset. Used for instance by shading correction algorithm X
ipsdk::imaproc::attr::InFactor [Input] Multiplying factor. Used for instance by 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::imaproc::matchImagePlans (_pInPIParaboloidParams3d,_pInImg,eImagePlansMatchPolicy::eIPMP_ZCT) && 
ipsdk::processor::ifIsSet (_pInOptBlackImg,
 ipsdk::imaproc::matchSizeAndType (_pInImg,_pInOptBlackImg))

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)
# retrieve white image paraboloid model
paraboloidWhite, bResRead = PyIPSDK.readFromXmlFile(whiteParaboloidPath)
# image shading correction computation
outImg = itrans.paraboloidShadingCorrection2dImg(inImg, paraboloidWhite, 5.025, 254.02)

Example of C++ code :

Example informations

Associated library

IPSDKIPLIntensityTransform

Header file

#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/ParaboloidShadingCorrection2dImg/ParaboloidShadingCorrection2dImg.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, if exists
ImagePtr pBlackImg;
pBlackImg = loadTiffImageFile(blackPath);
const ipReal64 offset = .0;
const ipReal64 factor = 255.0;
ImagePtr pAutoOutImg = paraboloidShadingCorrection2dImg(pInImg, pBlackImg, pParaboloid, offset, factor);
See also
ParaboloidShadingCorrection2dImgLvl1
ParaboloidShadingCorrection2dImgLvl2
ParaboloidShadingCorrection2dImgLvl3

Function Documentation

◆ paraboloidShadingCorrection2dImg() [1/6]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  factor 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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

◆ paraboloidShadingCorrection2dImg() [2/6]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  factor,
const ipsdk::image::ImagePtr pOutImg 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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

◆ paraboloidShadingCorrection2dImg() [3/6]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  offset,
const ipReal64  factor 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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

◆ paraboloidShadingCorrection2dImg() [4/6]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  offset,
const ipReal64  factor,
const ipsdk::image::ImagePtr pOutImg 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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

◆ paraboloidShadingCorrection2dImg() [5/6]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pBlackImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  offset,
const ipReal64  factor 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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

◆ paraboloidShadingCorrection2dImg() [6/6]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::paraboloidShadingCorrection2dImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pBlackImg,
const ipsdk::imaproc::attr::ParaboloidParams3dConstPtr pWhiteImgModel,
const ipReal64  offset,
const ipReal64  factor,
const ipsdk::image::ImagePtr pOutImg 
)

wrapper function for Computes a shading-corrected image given in particular an offset and a factor, and a paraboloid model for the white image

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