In
geometric optics
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space such as the distance, shape, size, and relative position of figures. A mathematician who works in the field of geometry is ca ...
, distortion is a deviation from
rectilinear projection
Rectilinear means related to a straight line; it may refer to:
* Rectilinear grid, a tessellation of the Euclidean plane
* Rectilinear lens, a photographic lens
* Rectilinear locomotion, a form of animal locomotion
* Rectilinear polygon, a polygo ...
; a projection in which straight lines in a scene remain straight in an image. It is a form of
optical aberration
In optics, aberration is a property of optical systems, such as lenses, that causes light to be spread out over some region of space rather than focused to a point. Aberrations cause the image formed by a lens to be blurred or distorted, with th ...
.
Radial distortion
Although distortion can be irregular or follow many patterns, the most commonly encountered distortions are radially symmetric, or approximately so, arising from the symmetry of a
photographic lens
A camera lens (also known as photographic lens or photographic objective) is an optical lens or assembly of lenses used in conjunction with a camera body and mechanism to make images of objects either on photographic film or on other media capab ...
. These ''radial distortions'' can usually be classified as either ''barrel'' distortions or ''pincushion'' distortions.
Mathematically, barrel and pincushion distortion are
quadratic, meaning they increase as the ''square'' of distance from the center. In mustache distortion the
quartic (degree 4) term is significant: in the center, the degree 2 barrel distortion is dominant, while at the edge the degree 4 distortion in the pincushion direction dominates. Other distortions are in principle possible – pincushion in center and barrel at the edge, or higher order distortions (degree 6, degree 8) – but do not generally occur in practical lenses, and higher order distortions are small relative to the main barrel and pincushion effects.
Occurrence
In photography, distortion is particularly associated with
zoom lens
A zoom lens is a mechanical assembly of lens elements for which the focal length (and thus angle of view) can be varied, as opposed to a fixed-focal-length (FFL) lens (see prime lens).
A true zoom lens, also called a parfocal lens, is one ...
es, particularly large-range zooms, but may also be found in prime lenses, and depends on focal distance – for example, the
Canon EF 50mm 1.4 exhibits barrel distortion at extremely short focal distances. Barrel distortion may be found in wide-angle lenses, and is often seen at the wide-angle end of zoom lenses, while pincushion distortion is often seen in older or low-end
telephoto lens
A telephoto lens, in photography and cinematography, is a specific type of a long-focus lens in which the physical length of the lens is shorter than the focal length. This is achieved by incorporating a special lens group known as a ''telephoto ...
es. Mustache distortion is observed particularly on the wide end of zooms, with certain
retrofocus lenses, and more recently on large-range zooms such as the
Nikon
(, ; ), also known just as Nikon, is a Japanese multinational corporation headquartered in Tokyo, Japan, specializing in optics and imaging products. The companies held by Nikon form the Nikon Group.
Nikon's products include cameras, camera ...
18–200 mm.
A certain amount of pincushion distortion is often found with visual optical instruments, e.g.,
binoculars
Binoculars or field glasses are two refracting telescopes mounted side-by-side and aligned to point in the same direction, allowing the viewer to use both eyes (binocular vision) when viewing distant objects. Most binoculars are sized to be held ...
, where it serves to eliminate the
globe effect.
In order to understand these distortions, it should be remembered that these are ''radial'' defects; the optical systems in question have
rotational symmetry
Rotational symmetry, also known as radial symmetry in geometry, is the property a shape has when it looks the same after some rotation by a partial turn. An object's degree of rotational symmetry is the number of distinct orientations in which i ...
(omitting non-radial defects), so the
didactic
Didacticism is a philosophy that emphasizes instructional and informative qualities in literature, art, and design. In art, design, architecture, and landscape, didacticism is an emerging conceptual approach that is driven by the urgent need to ...
ally correct test image would be a set of
concentric
In geometry, two or more objects are said to be concentric, coaxal, or coaxial when they share the same center or axis. Circles, regular polygons and regular polyhedra, and spheres may be concentric to one another (sharing the same center point ...
circles having even separation—like a shooter's target. It will then be observed that these common distortions actually imply a nonlinear radius mapping from the object to the image: What is seemingly pincushion distortion, is actually simply an exaggerated radius mapping for large radii in comparison with small radii. A graph showing radius transformations (from object to image) will be steeper in the upper (rightmost) end. Conversely, barrel distortion is actually a diminished radius mapping for large radii in comparison with small radii. A graph showing radius transformations (from object to image) will be less steep in the upper (rightmost) end.
Chromatic aberration
Radial distortion that depends on wavelength is called "
lateral chromatic aberration
Lateral is a geometric term of location which may refer to:
Healthcare
*Lateral (anatomy), an anatomical direction
*Lateral cricoarytenoid muscle
*Lateral release (surgery), a surgical procedure on the side of a kneecap
Phonetics
*Lateral cons ...
" – "lateral" because radial, "chromatic" because dependent on color (wavelength). This can cause colored fringes in high-contrast areas in the outer parts of the image. This should not be confused with ''axial'' (longitudinal) chromatic aberration, which causes aberrations throughout the field, particularly
purple fringing
In photography (particularly digital photography), purple fringing (sometimes called PF) is the term for an unfocused purple or magenta "ghost" image on a photograph. This optical aberration is generally most visible as a coloring and lightenin ...
.
Origin of terms
The names for these distortions come from familiar objects which are visually similar.
File:Barrel (PSF).png, In barrel distortion, straight lines bulge ''outwards'' at the center, as in a barrel
A barrel or cask is a hollow cylindrical container with a bulging center, longer than it is wide. They are traditionally made of wooden staves and bound by wooden or metal hoops. The word vat is often used for large containers for liquids, ...
.
File:Cushion.jpg, In pincushion distortion, corners of squares form elongated points, as in a cushion
A cushion is a soft bag of some ornamental material, usually stuffed with wool, hair, feathers, polyester staple fiber, non-woven material, cotton, or even paper torn into fragments. It may be used for sitting or kneeling upon, or to soften th ...
.
File:Handlebar-moustache.svg, In mustache distortion, horizontal lines bulge up in the center, then bend the other way as they approach the edge of the frame (if in the top of the frame), as in curly handlebar mustache
A handlebar moustache is a moustache with particularly lengthy and upwardly curved extremities. These moustache styles are named for their resemblance to the handlebars of a bicycle. It is also known as a spaghetti moustache, because of its ste ...
s.
Software correction
With uncorrected barrel distortion (at 26mm)
Barrel distortion corrected with software (this is the computer)">ENIAC computer)
Radial distortion, whilst primarily dominated by low-order radial components,
can be corrected using Brown's distortion model,
also known as the Brown–Conrady model based on earlier work by Conrady. The Brown–Conrady model corrects both for radial distortion and for tangential distortion caused by physical elements in a lens not being perfectly aligned. The latter is also known as ''decentering distortion''. See Zhang
for additional discussion of radial distortion. The Brown-Conrady distortion model is
where
*
is the distorted image point as projected on image plane using specified lens;
*
is the undistorted image point as projected by an ideal
pinhole camera
A pinhole camera is a simple camera without a lens but with a tiny aperture (the so-called ''pinhole'')—effectively a light-proof box with a small hole in one side. Light from a scene passes through the aperture and projects an inverted image o ...
;
*
is the distortion center;
*
is the
radial distortion coefficient;
*
is the
tangential distortion coefficient; and
*
=
, the
Euclidean distance
In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points.
It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefor ...
between the distorted image point and the distortion center.
Barrel distortion typically will have a negative term for
whereas pincushion distortion will have a positive value. Moustache distortion will have a non-
monotonic
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
radial
geometric series
In mathematics, a geometric series is the sum of an infinite number of terms that have a constant ratio between successive terms. For example, the series
:\frac \,+\, \frac \,+\, \frac \,+\, \frac \,+\, \cdots
is geometric, because each succ ...
where for some
the sequence will change sign.
To model radial distortion, the division model
typically provides a more accurate approximation than Brown-Conrady's even-order polynomial model,
using the same parameters previously defined. For radial distortion, this division model is often preferred over the Brown–Conrady model, as it requires fewer terms to more accurately describe severe distortion.
Using this model, a single term is usually sufficient to model most cameras.
Software can correct those distortions by
warping the image with a reverse distortion. This involves determining which distorted pixel corresponds to each undistorted pixel, which is non-trivial due to the
non-linearity
In mathematics and science, a nonlinear system is a system in which the change of the output is not proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, mathematicians, and many other ...
of the distortion equation.
Lateral chromatic aberration (purple/green fringing) can be significantly reduced by applying such warping for red, green and blue separately.
Distorting or undistorting requires either both sets of coefficients or inverting the non-linear problem which, in general, lacks an analytical solution. Standard approaches such as approximating, locally linearizing and iterative solvers all apply. Which solver is preferable depends on the accuracy required and the computational resources available.
Calibrated
Calibrated systems work from a table of lens/camera transfer functions:
* Adobe Photoshop Lightroom and Photoshop CS5 can correct complex distortion.
* PTlens is a Photoshop plugin or standalone application which corrects complex distortion. It not only corrects for linear distortion, but also second degree and higher nonlinear components.
* Lensfun is a free to use database and library for correcting lens distortion.
OpenCVis an open-source BSD-licensed library for computer vision (multi-language, multi-OS). It features a module for camera calibration.
*
DxO's PhotoLab software can correct complex distortion, and takes into account the focus distance.
*
proDAD Defishr includes an Unwarp-tool and a Calibrator-tool. Due to the distortion of a checkerboard pattern, the necessary unwrap is calculated.
* The
Micro Four Thirds system cameras and lenses perform automatic distortion correction using correction parameters that are stored in each lens's firmware, and are applied automatically by the camera and
raw
Raw is an adjective usually describing:
* Raw materials, basic materials from which products are manufactured or made
* Raw food, uncooked food
Raw or RAW may also refer to:
Computing and electronics
* .RAW, a proprietary mass spectrometry dat ...
converter software. The optics of most of these lenses feature substantially more distortion than their counterparts in systems that don't offer such automatic corrections, but the software-corrected final images show noticeably less distortion than competing designs.
Manual
Manual systems allow manual adjustment of distortion parameters:
*
ImageMagick
ImageMagick, invoked from the command line as magick, is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images. Created in 1987 by John Cristy, it can read and write ove ...
can correct several distortions; for example the fisheye distortion of the popular GoPro Hero3+ Silver camera can be corrected by the command
:
convert distorted_image.jpg -distort barrel "0.06335 -0.18432 -0.13009" corrected_image.jpg
*
Photoshop
Adobe Photoshop is a raster graphics editor developed and published by Adobe Inc. for Windows and macOS. It was originally created in 1988 by Thomas and John Knoll. Since then, the software has become the industry standard not only in raster ...
CS2 and
Photoshop Elements
Adobe Photoshop is a raster graphics editor developed and published by Adobe Inc. for Windows and macOS. It was originally created in 1988 by Thomas and John Knoll. Since then, the software has become the industry standard not only in raster ...
(from version 5) include a manual Lens Correction filter for simple (pincushion/barrel) distortion
*
Corel Paint Shop Pro Photo
PaintShop Pro (PSP) is a raster and vector graphics editor for Microsoft Windows. It was originally published by Jasc Software. In October 2004, Corel purchased Jasc Software and the distribution rights to Paint Shop Pro. PSP functionality can b ...
includes a manual Lens Distortion effect for simple (barrel, fisheye, fisheye spherical and pincushion) distortion.
*
GIMP
GIMP ( ; GNU Image Manipulation Program) is a free and open-source raster graphics editor used for image manipulation (retouching) and image editing, free-form drawing, transcoding between different image file formats, and more specialized task ...
includes manual lens distortion correction (from version 2.4).
*
PhotoPerfect has interactive functions for general pincushion adjustment, and for fringe (adjusting the size of the red, green and blue image parts).
*
Hugin Hugin may refer to:
* Bob Hugin (born 1954), American politician and businessman
* Hugin (longship), a Danish reconstruction of a Viking longship on display in Ramsgate, England
* HUGIN, a widely used tool for uncertain reasoning using Bayesian net ...
can be used to correct distortion, though that is not its primary application.
Besides these systems that address images, there are some that also adjust distortion parameters for videos:
*
FFMPEG
FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of vid ...
using the "lenscorrection" video filter.
*
Blender
A blender (sometimes called a mixer or liquidiser in British English) is a kitchen appliance, kitchen and laboratory appliance used to mix, crush, purée or emulsion, emulsify food and other substances. A stationary blender consists of a blender ...
by using the node editor to insert a "Distort/Lens Distortion" node between the input and output nodes.
Related phenomena
Radial distortion is a failure of a lens to be
rectilinear: a failure to image lines into lines. If a photograph is not taken straight-on then, even with a perfect rectilinear lens, rectangles will appear as
trapezoid
A quadrilateral with at least one pair of parallel sides is called a trapezoid () in American and Canadian English. In British and other forms of English, it is called a trapezium ().
A trapezoid is necessarily a Convex polygon, convex quadri ...
s: lines are imaged as lines, but the angles between them are not preserved (tilt is not a
conformal map
In mathematics, a conformal map is a function that locally preserves angles, but not necessarily lengths.
More formally, let U and V be open subsets of \mathbb^n. A function f:U\to V is called conformal (or angle-preserving) at a point u_0\in ...
). This effect can be controlled by using a
perspective control lens
Perspective may refer to:
Vision and mathematics
* Perspectivity, the formation of an image in a picture plane of a scene viewed from a fixed point, and its modeling in geometry
** Perspective (graphical), representing the effects of visual persp ...
, or
corrected in post-processing.
Due to
perspective, cameras image a cube as a square
frustum
In geometry, a (from the Latin for "morsel"; plural: ''frusta'' or ''frustums'') is the portion of a solid (normally a pyramid or a cone) that lies between two parallel planes cutting this solid. In the case of a pyramid, the base faces are p ...
(a truncated pyramid, with trapezoidal sides)—the far end is smaller than the near end. This creates perspective, and the rate at which this scaling happens (how quickly more distant objects shrink) creates a sense of a scene being deep or shallow. This cannot be changed or corrected by a simple transform of the resulting image, because it requires 3D information, namely the depth of objects in the scene. This effect is known as
perspective distortion; the image itself is not distorted, but is perceived as distorted when viewed from a normal viewing distance.
Note that if the center of the image is closer than the edges (for example, a straight-on shot of a face), then barrel distortion and wide-angle distortion (taking the shot from close) both increase the size of the center, while pincushion distortion and telephoto distortion (taking the shot from far) both decrease the size of the center. However, radial distortion bends straight lines (out or in), while perspective distortion does not bend lines, and these are distinct phenomena.
Fisheye lens
A fisheye lens is an ultra wide-angle lens that produces strong visual distortion intended to create a wide panoramic or hemispherical image. Fisheye lenses achieve extremely wide angles of view, well beyond any rectilinear lens. Instead of pr ...
es are wide-angle lenses with heavy barrel distortion and thus exhibit ''both'' these phenomena, so objects in the center of the image (if shot from a short distance) are particularly enlarged: even if the barrel distortion is corrected, the resulting image is still from a wide-angle lens, and will still have a wide-angle perspective.
See also
*
Anamorphosis
Anamorphosis is a distorted projection requiring the viewer to occupy a specific vantage point, use special devices, or both to view a recognizable image. It is used in painting, photography, sculpture and installation, toys, and film special e ...
*
Angle of view
The angle of view is the decisive variable for the visual perception of the size or projection of the size of an object.
Angle of view and perception of size
The perceived size of an object depends on the size of the image projected onto the ...
*
Cylindrical perspective
Cylindrical perspective is a form of distortion caused by fisheye and panoramic lenses which reproduce straight horizontal lines above and below the lens axis level as curved while reproducing straight horizontal lines on lens axis level as str ...
*
Distortion
In signal processing, distortion is the alteration of the original shape (or other characteristic) of a signal. In communications and electronics it means the alteration of the waveform of an information-bearing signal, such as an audio signal ...
*
Texture gradient
Texture gradient is the distortion in size which closer objects have compared to objects farther away. It also involves groups of objects appearing denser as they move farther away. Additionally, it could be explained by noticing a certain amount ...
*
Underwater vision
Underwater vision is the ability to see objects underwater, and this is significantly affected by several factors. Underwater, objects are less visible because of lower levels of natural illumination caused by rapid attenuation of light with dist ...
*
Vignetting
In photography and optics, vignetting is a reduction of an image's brightness or saturation toward the periphery compared to the image center. The word ''vignette'', from the same root as ''vine'', originally referred to a decorative border ...
References
External links
Lens distortion estimation and correctionwith source code and online demonstration
Lens distortion correction on post-processing
{{DEFAULTSORT:Distortion (Optics)
Geometrical optics