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. | |
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.
|
inline |
Construct a polynomial using the given coefficients.
| 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 |
|
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.
|
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().
| x | x position in normalized coordinates |
| y | y position in normalized coordinates |
|
inline |
Set the reference image size.
Set the reference image size that is used for subsequent calls to getM() and sampleAtNormalizedPixelPos()
| size | The size of the reference image |