Monday 27 March 2017

lens - What is the difference between perspective distortion and barrel or pincushion distortion?


I've heard of:



  • perspective distortion

  • barrel distortion


  • pincushion distortion

  • mustache distortion


What are these different types of distortion, and how do they relate? What causes them, and can they be corrected in the field, or in software post-production?


What about "fisheye projection" — is that a kind of distortion, too?


I've also heard the terms "lens distortion" and "geometric distortion" — are those yet more kinds of distortions, or broader categories, or what?



Answer



Perspective is determined by the position of the camera relative to the scene. When a camera position produces a perspective that makes an object or scene look different than we might expect it to look we call that perspective distortion.


All of the other distortions listed are a result of the way lenses bend light as the light passes through them. They are the result of the geometry with which a lens projects a virtual image of the scene from which the light rays passing through the lens originate.


Perspective Distortion



Perspective distortion is kind of a misnomer. There is really only perspective. It is determined by a viewing position of a scene. In the context of photography perspective is a result of the position of the camera in relation to the scene as well as the positions of the various elements in the scene with respect to one another. What we call perspective distortion is a perspective that gives us a view of a scene or object within that scene that is different from what we would normally expect the scene or object to look like.


If one takes a photo of a three dimensional cube from a position very close to one corner the nearest corner of the cube appears to be stretched towards the camera. If one takes a photo of the same cube from a much greater distance and a much longer focal length so that the cube is the same size in the frame, the same corner of the cube appears to be flattened.



Image copyright 2007 SharkD, licensed CC-BY-SA 3.0


Many people misunderstand that it is the focal length of the lenses that cause the difference. It is not. It is the shooting position used to frame the cube with the two different lenses. If we had a camera and wide angle lens, both with sufficient resolution, and shot the cube with the wide angle lens from the same position as we had filled the frame with the cube using the longer focal length lens and then cropped the resulting photo so the cube is the same size the perspective would also be the same - the cube would appear just as flattened as when we shot it using the longer lens.


If one takes a photo of a rectangular skyscraper from the sidewalk across a narrow street the top of the building will look much narrower than the bottom. (Unless we were to properly use a tilt/shift perspective control lens or a view camera capable of perspective control movements.) When we view the scene with our own eyes our brain compensates for this difference and we perceive that the top of the building is the same width as the bottom. But when we view the photo we took from the same spot we don't give our brain the same full battery of clues (mainly our stereo vision due to having two eyes) and our brain does not perceive the photo in the same way as it perceived the actual scene from the same position.


The same is true when we take a portrait of a face from such a close distance that the nose looks twice as large as the ears. The nose is so much closer to the camera than the ears are that they appear much larger in proportion to the ears than they really are. When we view another person's face from such a distance with our eyes our brain processes the scene and corrects for the differences in distance between the various parts of the face in front of us. But when we view a photo taken from the same distance our brain lacks all of the clues it needs and can't build the same corrected 3D model in our perception of the photo.


Consider what we refer to as telephoto compression:



Let's assume you are 10 feet away from your friend Joe and take his picture in portrait orientation with a 50mm lens. Say there is a building 100 feet behind Joe. The building is 10X the distance from the camera as Joe is, so if Joe is 6 feet tall and the building is 60 feet tall they will appear to be the same height in your photo, because both would occupy about 33º of the 40º angle of view of a 50mm lens along the longer dimension.



Now back up 30 feet and use a 200mm lens. Your total distance from Joe is now 40 feet which is 4X further than the 10 feet you used with the 50mm lens. Since you are using a focal length that is 4X the original 50mm (50mm X 4 = 200mm), he will appear the same height in the second photo as he did in the first. The building, on the other hand, is now 130 feet from the camera. That is only 1.3X as far as it was in the first shot (100ft X 1.3 = 130ft), but you have increased the focal length by 4X. Now the 60 foot tall building will appear to be roughly 3X the height of Joe in the picture (100ft / 130ft = 0.77; 0.77 X 4 = 3.08). At least it would if all 60 feet of it could fit in the picture, but it can't fit at that distance with a 200mm lens.


Another way to look at it is that in the first photo with the 50mm lens, the building was 10X further away than Joe was (100ft / 10ft = 10). In the second photo with the 200mm lens, the building was only 3.25X further away than Joe was (130ft / 40ft = 3.25), even though the distance between Joe and the building was the same. What changed was the ratio of the distance from the camera to Joe and the distance of the camera to the building. That is what defines perspective: The ratio of the distances between the camera and various elements of a scene.



In the end, the only thing that determines perspective is camera position and the relative positions of the various elements of the scene.


For a look at how even a fairly slight difference in perspective affects an image, please see: Why is the background bigger and blurrier in one of these images?


Lens Distortions


Lens distortions are caused by the way a lens projects a virtual image of the light that enters the front of the lens out the back of the lens. The following terms are various types of lens distortions. Lens distortions are sometimes called geometric distortions because they affect the way geometrical shapes are depicted by a lens.


Barrel Distortion is a geometric distortion where straight lines appear to be curved away from the center of the image. This is caused by magnification being greater at the center of the lens than at the edges. Most lenses with barrel distortion are wider angle lenses that squeeze a very wide scene onto a narrower sensor or piece of film. The ultimate in barrel distortion is a fisheye lens, which sacrifices rectilinear projection in favor of a wider field of view gained by spherical projection. A set of straight horizontal and vertical lines subject to barrel distortion:


barrel distortion


Pincushion Distortion is a geometric distortion where straight lines appear to be curved towards the center of the image. This is caused by magnification being greater at the edge of the lens than at the center. Pincushion distortion tends to show up on the longer focal length end of zoom lenses. A set of straight horizontal and vertical lines subject to pincushion distortion:



Pincushion distortion


Mustache Distortion is, strictly speaking, a geometric distortion that demonstrates barrel distortion close to the center of the optical axis and gradually transitions to pincushion distortion near the edges. Sometimes other patterns of distortion caused by partially correcting barrel or pincushion distortion are also labeled as mustache distortion. A set of straight horizontal and vertical lines subject to mustache distortion:


Mustache distortion


Zoom lenses tend to demonstrate more geometric distortion than their single focal length counterparts. A prime lens, which is a lens with only a single focal length, can be tuned to best correct geometric distortion at that one focal length. A zoom lens must compromise to try and control distortion at all focal lengths. If the pincushion distortion is highly corrected for the longer end, the barrel distortion would be more severe at the wide end. If the barrel distortion is highly corrected on the wide end, it would exacerbate the pincushion distortion on the long end. The wider the ratio is between the widest angle and longest ends of a zoom lens' focal lengths, the tougher the tightrope is to properly correct geometric distortions at both ends.


Even with prime lenses it costs more to precisely correct lenses for geometric distortion than it does to correct them "just close enough". It costs more in term of research and development in the design stage of the lens. It costs more in terms of the number of optical elements used, the amount of materials needed to make those elements, and the cost of more exotic materials used to make some of the most effective corrective elements. It costs more to manufacture those increased number of optical elements, sometimes into more exotic irregular shapes, and at higher tolerances.


Some of the most expensive lenses are also some of the most highly corrected lenses for optical distortions. Lenses such as the Zeiss line of Otus lenses, for example. The cheapest zoom lenses tend to be lenses that display the most geometric distortion as well as other optical aberrations.


Correcting Lens Distortions



What causes them, and can they be corrected in the field, or in software post-production?




The cause of geometric lens distortions is the design of the lens and the way it bends the light that passes through it. Many simple lenses demonstrate geometric distortion of one kind or another. How much a lens corrects for that distortion depends on additional corrective elements added to a lens' optical formula.


The best way to correct geometric lens distortion in the field is to use the lens available at the time that demonstrates the least amount of undesirable distortion.


One can correct geometric distortion using in-camera processing of the image (if the camera has that capability) or in post-processing, but it comes with several caveats.



  • As the edges are curved to correct for geometric distortion the coverage of the field of view is reduced if the rectangular or square shape of the overall image is preserved. Not everything seen on the edges in the uncorrected image will appear in the corrected image.

  • When pixels are remapped resolution may be lost. If the lens is fairly soft and blurry to begin with, this will probably not even be measurable, much less noticeable. But with higher resolution lenses used on higher resolution cameras this can have both a measurable effect and even a noticeable effect at larger display sizes. As Roger Cicala, LensGuruGod1 at lensrentals.com, says in a blog post devoted to the topic,



"You CAN Correct It In Post, but . . .
. . . . there is no free lunch.





  • Any in-camera correction applied to the image when shooting RAW will be reflected in the preview jpeg generated and appended to the raw file, but whether the correction will be applied in post-processing depends upon which raw convertor one uses. In general, third party raw converters such as Lightroom will ignore the instructions regarding correction included in the "maker notes" section of the EXIF information while most camera makers' in house software will apply the in-camera settings when opening a raw file. Also, the correction one can apply using a third party raw converter such as Lightroom will be done using lens profiles provided by that third party application rather than the lens profile, normally provided by the camera manufacturers, used in-camera to generate the jpeg preview or in post using the camera makers' own software. On the other hand, most manufacturers only provide correction profiles for their own lenses (for either in-camera or post-production correction) while third party raw converters will sometimes have profiles available for third party lenses.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...