easyidp.reconstruct.Calibration#

class easyidp.reconstruct.Calibration(sensor=None)#

The base class for camera lens distortion calibration

__init__(sensor=None)#

Methods

__init__([sensor])

calibrate(u, v)

Convert undistorted images -> original image pixel coordinate

Attributes

software

the calibration model from which reconstruction software, in ["pix4d", "metashape"], <class 'str'>

type

the calibration type, same as the sensor.type, in [frame, fisheye, spherical, rpc], by default 'frame'

sensor

the object of the camera model (sensor), Sensor

f

focal length, unit is pixel, for pix4d project, convert mm to pixel.

cx

principle point offset, unit is pixel.

cy

principle point offset, unit is pixel.

b1

affinity and non-orthogonality (skew) coefficients (in pixels) [metashape use only]

b2

affinity and non-orthogonality (skew) coefficients (in pixels) [metashape use only]

k1

len distortion coefficient, different between pix4d and metashape, please check below for more details

k2

len distortion coefficient

k3

len distortion coefficient

k4

len distortion coefficient

t1

Tangential Lens Distortion Coefficients, for Pix4D.

t2

Tangential Lens Distortion Coeffs

t3

Tangential Lens Distortion Coeffs

t4

Tangential Lens Distortion Coeffs

p1

Tangential Lens Distortion Coefficients, for Metashape.

p2

Tangential Lens Distortion Coeffs

p3

Tangential Lens Distortion Coeffs

p4

Tangential Lens Distortion Coeffs

b1#

affinity and non-orthogonality (skew) coefficients (in pixels) [metashape use only]

b2#

affinity and non-orthogonality (skew) coefficients (in pixels) [metashape use only]

calibrate(u, v)#

Convert undistorted images -> original image pixel coordinate

Parameters:
  • u (ndarray) – the x pixel coordinate after R transform

  • v (ndarray) – the y pixel coordinate after R transform

Returns:

the pixel coordinate on the original image

Return type:

xb, yb

Note

The calculation formular can be references by :

  • Pix4D: #2.1.2 section in [1] .

  • Metashape: Appendix C. Camera models in [2] .

cx#

principle point offset, unit is pixel.

Note

In the older version of metashape, Cx and Cy were given in pixels from the top-left corner of the image. But in the latest release version they are measured as offset from the image center. Reference: https://www.agisoft.com/forum/index.php?topic=5827.0`

cy#

principle point offset, unit is pixel.

f#

focal length, unit is pixel, for pix4d project, convert mm to pixel. <class 'float'>

k1#

len distortion coefficient, different between pix4d and metashape, please check below for more details

  • pix4d: Symmetrical Lens Distortion Coeffs

  • metashape: radial distortion coefficients (dimensionless)

k2#

len distortion coefficient

k3#

len distortion coefficient

k4#

len distortion coefficient

p1#

Tangential Lens Distortion Coefficients, for Metashape.

Note

  • pix4d: Tangential Lens Distortion Coeffs, use T

  • metashape: tangential distortion coefficient, use P

p2#

Tangential Lens Distortion Coeffs

p3#

Tangential Lens Distortion Coeffs

p4#

Tangential Lens Distortion Coeffs

sensor#

the object of the camera model (sensor), Sensor

software#

the calibration model from which reconstruction software, in [“pix4d”, “metashape”], <class 'str'>

t1#

Tangential Lens Distortion Coefficients, for Pix4D.

Note

  • pix4d: Tangential Lens Distortion Coeffs, use T

  • metashape: tangential distortion coefficient, use P

t2#

Tangential Lens Distortion Coeffs

t3#

Tangential Lens Distortion Coeffs

t4#

Tangential Lens Distortion Coeffs

type#

the calibration type, same as the sensor.type, in [frame, fisheye, spherical, rpc], by default ‘frame’