Designer Plugins
Plugins for Disguise Designer software.
Plugins for Disguise Designer software.
A distortion model similar to OpenCV is supported, including:
Equations: A full radial distortion term is for example given by: rad_term = (1 + k1r^2 + k2r^4 + k3r^6) / (1 + k4r^2 + k5r^4 + k6r^6) Often only some of these coefficients are actually used (see below). Barrel distortion typically will have a positive term for k1 whereas pincushion distortion will have a negative value.
The tangential distortion term is given by: tang_term = 2p1 + p2 * (r^2 + 2x^2)
Where r is the radius of undistortion, (x,y) are distorted image coordinates and the centre of the radial distortion is given by (x_c,y_c): r^2 = (x - x_c)^2 + (y - y_c)^2 The centre of the radial distortion is usually assumed to be the principal point in the image plane (see InternalParams).
Often the tangential distortion term is neglected, but it is in part implicitly modelled through the shift of the principal point away from the image centre.
Practical usage: Not all coefficients have to be used for calibration and correction. For practical use it needs to be decided which coefficients should be estimated during calibration. According to Zhang*, the first 2 even radial distortion coefficients usually dominate the distortion function. Trying to estimate more can cause numerical instability. Therefore either only k1, k1+k2, k1+k2+k3 or all 6 radial distortion coefficients could be considered in calculations. How many coefficients to limit yourself to should depend on the input data:
Chromatic aberration: Lateral chromatic aberration (visible as green and purple fringes in camera images) can be significantly compensated by applying undistortion with different radial distortion coefficients to each R,G,B colour channel.
Direction of non-linear coordinate transformation: It is important to note that the distortion coefficients can express a transformation from distorted image coordinates to undistorted one, or vice versa. Due to the non-linearity, this direction cannot be easily inverted simply by modifying the coefficients! For example, the coefficients calculated by OpenCV are valid for the transformation from undistorted to distorted coordinates. When applying (un-)distortion on image coordinates it is therefore important to consider the “direction” of the coefficients and also how a certain distort() or undistort() function interprets them! See: method isUndist2Dist()
Unit of coefficients: The distortion coefficients can be applied to either pixel coordinates or normalised coordinates. If operating on pixel coordinates, every radial distortion coefficient has for example a respective unit of pixels^-2, pixels^-4 or pixels^-6. Otherwise they are unit-less, which has the advantage that they don’t depend on the camera resolution. Distortion coefficients directly calculated by OpenCV are unit-less, so they can be applied to normalised coordinates. See: method isUnitPixels()
NOTE: In OpenCV and most literature (e.g. Zhang) k1, k2 are defined as the first 2 coefficients for radial distortion that are associated with even exponents, e.g. that are multiplied by r^2 and r^4, respectively. In some publications (e.g. Hartley) these are called k2 and k4, because coefficients that correspond to odd exponents could also be considered (coming from a full Taylor expansion 1 + k1r + k2r^2 + …).
See: Z. Zhang, �A flexible new technique for camera calibration�, IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(11)
�1334, 2000. See: http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html See: R. Hartley, A.Zisserman: “Multiple View Geometry in computer vision” 2nd edition, 2003. See: O. Faugeras, Q.-T. Luong: “The Geometry of Multiple Images”, 2001; p.232. See: B. Cyganek, J.P. Siebert: “An Introduction to 3D Computer Vision Techniques and Algorithms”, 2009; p. 27.Base class: _BlipValue