iptransform: apply distortion and CA correction in a single pass
Some lens profile methods provides a way to correct distortion and CA in a single step. When available, applying distortion and CA correction when both enabled in a single pass is more precise (see lensfun ApplySubpixelGeometryDistortion doc) since it's usually how the profile is done. Instead applying the CA correction in a step after distortion correction could lead to a bit different (also if not always visible) correction. This is also required for future lens correction methods (like DNG WarpRectilinear or corrections based on vendor metadata) that provides only merged distortion and CA correction in a single pass.
This commit is contained in:
@@ -1233,12 +1233,12 @@ void ImProcFunctions::transformGeneral(bool highQuality, Imagefloat *original, I
|
||||
double Dx = Dxr;
|
||||
double Dy = Dyr;
|
||||
|
||||
if (enableLCPCA) {
|
||||
pLCPMap->correctCA(Dx, Dy, w2, h2, c);
|
||||
}
|
||||
|
||||
if (enableLCPDist) {
|
||||
if (enableLCPDist && enableLCPCA) {
|
||||
pLCPMap->correctDistortionAndCA(Dx, Dy, w2, h2, c);
|
||||
} else if (enableLCPDist) {
|
||||
pLCPMap->correctDistortion(Dx, Dy, w2, h2);
|
||||
} else if (enableLCPCA) {
|
||||
pLCPMap->correctCA(Dx, Dy, w2, h2, c);
|
||||
}
|
||||
|
||||
// distortion correction
|
||||
|
Reference in New Issue
Block a user