Class SimpleLensDistortionMetashape

java.lang.Object
org.jvision.camera.distortion.SimpleLensDistortionMetashape
All Implemented Interfaces:
LensDistortion, LensDistortionMetashape

public class SimpleLensDistortionMetashape extends Object implements LensDistortionMetashape
A class dedicated to the handling of lens distortion within the Agisoft Metashape(c) convention.
The distortion is used to compute distorted / undistorted points for a given camera. Let (X, Y, Z) be a 3D point expressed within the camera referential.

A new point (u, v) that integrate distortion (a distorted point) can be obtained a follows:
 
x=X / Z
y=Y / Z
 
x'=x(1 + k1r2 + k2r4 + k3r6 + k4r8)+(P1(r2+2x2) + 2P2xy)
 
y'=x(1 + k1r2 + k2r4 + k3r6 + k4r8)+(P2(r2+2y2) + 2P1xy)

with:
  • (x', y') is a point within camera referential that is affected by the distortion.
  • r2 = x2 + y2.
  • k1, k2, k3, k4 are the radial distortion coefficients.
  • p1, p2 are the tangential distortion coefficients.
We got then:
 
u = w × 0.5 + cx + x'f + x'B1 + y'B2
v = h × 0.5 + cy + y'f

with:
  • (u, v) is a point within the image referential that is affected by the distortion expressed in pixels (px).
  • w is the digital image width in pixels (px).
  • h is the digital image height in pixels (px).
  • (cx, cy) is the principal point offset expressed in pixels (px).
  • f is the camera focal length in pixels (px).
  • B1 is the affinity coefficient.
  • B2 is the non-orthogonality (skew) coefficient.
As the parameters B1 and B2 are not part of the lens distortion, the last equation is not taken in account within this class computation.
Since:
1.0.0
Version:
"1.0.0" b202104211400L
Author:
Julien Seinturier - JOrigin - contact@jorigin.org - https://github.com/jorigin/jvision