libcamera: libcamera::ipa::LscPolynomial Class Reference

libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
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.
double | sampleAtNormalizedPixelPos (double x, double y) const
| Sample the polynomial at the given normalized pixel position.
double | getM () const
| Get the value m as described in the dng specification.
void | setReferenceImageSize (const Size &size)
| Set the reference image size.

## 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

  cx | Center-x relative to the image in normalized coordinates (0..1)
  cy | Center-y relative to the image in normalized coordinates (0..1)
  k0 | Coefficient of the polynomial
  k1 | Coefficient of the polynomial
  k2 | Coefficient of the polynomial
  k3 | Coefficient of the polynomial
  k4 | Coefficient of the polynomial

## Member Function Documentation

## ◆ getM()

double 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()

double 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

  x | x position in normalized coordinates
  y | y position in normalized coordinates

Returns
  The sampled value

## ◆ setReferenceImageSize()

void 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

  size | The size of the reference image

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

- src/ipa/libipa/lsc_polynomial.h
- src/ipa/libipa/lsc_polynomial.cpp