libcamera  v0.4.0
Supporting cameras in Linux since 2019
Public Member Functions | List of all members
libcamera::ipa::LscPolynomial Class Reference

Class for handling even polynomials used in lens shading correction. More...

Public Member Functions

 LscPolynomial (double cx=0.0, double cy=0.0, double k0=0.0, double k1=0.0, double k2=0.0, double k3=0.0, double k4=0.0)
 Construct a polynomial using the given coefficients. More...
 
double sampleAtNormalizedPixelPos (double x, double y) const
 Sample the polynomial at the given normalized pixel position. More...
 
double getM () const
 Get the value m as described in the dng specification. More...
 
void setReferenceImageSize (const Size &size)
 Set the reference image size. More...
 

Detailed Description

Class for handling even polynomials used in lens shading correction.

Shading artifacts of camera lenses can be modeled using even radial polynomials. This class implements a polynomial with 5 coefficients which follows the definition of the FixVignetteRadial opcode in the Adobe DNG specification.

Constructor & Destructor Documentation

◆ LscPolynomial()

libcamera::ipa::LscPolynomial::LscPolynomial ( double  cx = 0.0,
double  cy = 0.0,
double  k0 = 0.0,
double  k1 = 0.0,
double  k2 = 0.0,
double  k3 = 0.0,
double  k4 = 0.0 
)
inline

Construct a polynomial using the given coefficients.

Parameters
cxCenter-x relative to the image in normalized coordinates (0..1)
cyCenter-y relative to the image in normalized coordinates (0..1)
k0Coefficient of the polynomial
k1Coefficient of the polynomial
k2Coefficient of the polynomial
k3Coefficient of the polynomial
k4Coefficient of the polynomial

Member Function Documentation

◆ getM()

libcamera::ipa::LscPolynomial::getM ( ) const
inline

Get the value m as described in the dng specification.

Returns m according to dng spec. m represents the Euclidean distance (in pixels) from the optical center to the farthest pixel in the image.

Returns
The sampled value

◆ sampleAtNormalizedPixelPos()

libcamera::ipa::LscPolynomial::sampleAtNormalizedPixelPos ( double  x,
double  y 
) const
inline

Sample the polynomial at the given normalized pixel position.

This functions samples the polynomial at the given pixel position divided by the value returned by getM().

Parameters
xx position in normalized coordinates
yy position in normalized coordinates
Returns
The sampled value

◆ setReferenceImageSize()

libcamera::ipa::LscPolynomial::setReferenceImageSize ( const Size size)
inline

Set the reference image size.

Set the reference image size that is used for subsequent calls to getM() and sampleAtNormalizedPixelPos()

Parameters
sizeThe size of the reference image

The documentation for this class was generated from the following files: