IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Paraboloid Image Fitting 2dSee full documentation
ParaboloidParams3dparaboloidImgFit2d (inImg)
ParaboloidParams3dparaboloidImgFit2d (inImg,maskImg)

Detailed Description

algorithm fitting intensities of a 2d image with a 3d paraboloid

Considering a 2d image as a 3d surface, with the pixels intensities as the heights, this algorithm computes the paraboloid that best-fits this 3d surface. The paraboloid is described by the ipsdk::imaproc::attr::ParaboloidParams3d structure, that contains the parameters of its equation:

\[ X2Coef*x^2 + Y2Coef*y^2 + XYCoef*x*y + XCoef*x + YCoef*y + Constant = 0 \]

Here is an example of best-fitting paraboloid calculation on a 8-bits grey level image:

paraboloidImgFit2d.png

This algorithm can be used to artificially extract a white image from an input one, in order to apply next a shading correction to the input image. See Shading correction (white image represented as a paraboloid)

Warning
The method retained to compute the best-fitting paraboloid is fast but not robust. The returned paraboloid may be biased if the input 2d image is noisy.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# open input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# paraboloid fitting
paraboloid = glbmsr.paraboloidImgFit2d(inImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLGlobalMeasure/Processor/ParaboloidImgFit2d/ParaboloidImgFit2d.h>

Code Example

ImagePtr pInImg = loadTiffImageFile(tiffImageFilePath);
ParaboloidParams3dPtr pParaboloid = paraboloidImgFit2d(pInImg);