Correction of optical distortions

There are two reasons why your pictures might not get assembled correctly: a wrong setting of the entrance pupil and maybe even more optical distortions of your lens or zoom lens. This is due to the shape of your lens, the aspheric lens. Here is how to know and correct it...

Many objectives distort the images slightly and this is particularly visible on the architectural photos as in the photo opposite. For a very long time, the panorama software did not know how to detect and correct them automatically and our panoramas had very many assembly artifacts in the overlapping areas. Gradually, the panoramic software optimized and integrated these corrections until being able, sometimes, to correct them entirely. This is almost completely the case today, in 2017, Autopano or PTGui ... but not all the time. Indeed, there are still in 2017 objectives that fit less perfectly than others and it is not due to a bad adjustment of the nodal point but to their "sly" distortions.

Important note! A fault of assembly due to a bad adjustment of the nodal point furiously resembles the same defect of assembly but this time with a strongly distorted objective. The justice of the peace? Make an assembly by making sure you have perfectly adjusted the nodal point. If you observe assembly artifacts on your final panorama it's because your lens is too distorted. I advise you to choose another. Frankly !

The key points if you're a beginner...

Here are the key points to remember about optical distortions. The rest of this page is aimed at those who want to learn more.

OPTICAL DISTORTIONS ARE SOMETIMES AS IMPORTANT AS THE SETTING OF THE NODAL POINT.

A assembling problem because of a distortion problem really looks like a problem of nodal point setting. Some horizontal elements don't stitch perfectly.

Lens Correction in Camera Raw or Lightroom is often very efficient to correct a good number of optical distortions complicated to stitch.

Autopano Giga 4.4 and PTGui 10.0 are really very good nowadays to get rid of distortions problems. If you use this software, this problem won't bother you so often. So if you're using them, do look into the setting of the entrance pupil if you're experiencing assembling problems (or use the ramsac Homography model in Autopano).

Why you should choose a recent version of your favourite panorama software

Three striking evolutions in Autopano 2.6, 3.5 and 4.4!

Since Autopano Giga version 2.6 and maybe even more with the very last version 4.4, one of the new features, which is a major one according to me, is the introduction in assembling algorithms of a correction of complex lens distortions like short focals often suffer from. IT IS FINALLY POSSIBLE TO STITCH SHORT FOCALS (ALMOST) PERFECTLY FOR THE MOST PART OF THEM.

Some lenses that didn't stitch at all like 14 mm now stitch more than correctly. There are still a few Photoshop edits but it is nothing compared to the previous versions and other panorama software. Some other lenses, zoom lenses, short focals that just assembled correctly now stitch perfectly. Almost a miracle!
It is therefore important to "choose" your lens to create virtual tours. See my lens selection

My recommendation! when a panorama isn't well-assembled, so horizontal or vertical lines don't match perfectly, it is impossible to know whether it comes from a problem of complex distortions that the panorama software can't correct or if it's a parallax problem hence a wrong position of the camera at the entrance pupil. You can only know it if you're absolutely certain to have set your panoramic head at the entrance pupil of your lens perfectly.

Even if certain pieces of software can very well correct a classic distortion, simple from a mathematical point of view, a barrel distortion most of the time and even quite pronounced, numerous lenses are unfortunately cursed with distortions called "moustache distortion" or even "cop hat" which are really hard to correct and put numerous pieces of panorama software on their knees. And it really gets complicated when you add the naturally deformed shape of photos shot with a fisheye lens, full format or circular. Indeed, in this situation, you might say that a fisheye lens has two characteristics:

On the one hand a deformation of the image in fisheye, representing the most visible deformation, whether the lens is a full-format or circular fisheye, as in the image over here.The fisheye deformation doesn't need to be corrected to be assembled with most good assembling pieces of software nowadays. Camera Raw of Photoshop knows how to transform these images in orthoscopic ones, however.

On the other hand, "hidden" hidden behind the fisheye aspect and more vicious, a residual distortion, still in barrel, pin-cushion or moustache, hence invisible to the naked eye and that can be a real headache for panorama software if it's a moustache distortion. As for classic lenses.

Important remarks

Whether your virtual tour is assembled from photos shot with a fisheye or not, if your panorama software can't stitch them correctly AND you've checked the entrance pupil of your lens, it is sure that your lens has pronounced moustache distortions - most likely because of aspheric lenses -.
In certain cases, it reaches such a level that it's better to change lens to shoot the photos of the virtual tour. You'd spend too much time editing them in Photoshop... or change panorama software.

Some pairs camera / fisheye lens really proved themselves now and stitch very well directly, almost without Photoshop edits after the final assembling. It is the case of the pairs Nikon D5300, D7200, D300 + Nikkor 8-15 mm fisheye or, with Canon, of the pair 5D Mark III / IV + 8-15 mm fisheye. The Samyang 8mm fisheye is also a good surprise.

Old belief... fisheye lenses, despite what you could believe, stitch very well and always better than very short focals like 14 mm. A word to the wise is enough!

So here are a few leads but before, let's see more precisely what an optical distortion is...

Optical distortions?

Certain wide-angle lenses distort the edges of the image in a shape of "pincushion", "barrel" or even "moustache". So the edges of the images are either curved outwards in barrel (1), either inwards in pincushion (2), or a bit of each in moustache (3) as shown in the pictures below.

In two consecutive pictures, the optical error will be opposite. It's impossible for a photo panorama software to combine these two photos without a previous correction of this distortion because only two spots - at the junctions - are superimposed. The whole overlap zone should theoretically be completely blurred but it's not the case most of the time.

In the best case, some assembling pieces of software take it into account and this is why they come with a database on every digital camera on the market - including of course regular updates to take newcomers into account! -. Before assembling the images, the software will thus ask you with what camera the pictures were taken, unless it detects it automatically by reading the Exif data of the files.
In the case of numerous lenses, the distortions are really very important and it's essential to take them into account during the assembling process. With these lenses, when the photos stitch poorly and unlike one could think, it won't necessarily be a parallax problem hence of entrance pupil or nodal point but really of distortions. In most other cases, these distortions must absolutely be corrected before opening the pictures in the panorama software... whenever possible! There are few cases when, even a bit distorted, the images are assembled correctly because their distortion is "sane" hence simple.

Note

As an example, I'll take a case I've experienced with the lenses of the Olympus E1, E5, 500 or 330 and Autopano Pro 1.42. That's when I became aware of the problem and found solutions. Let's take the two wide-angle lenses I had: the 14-54mm and the 11-22 mm at 14 mm (thus equivalent to 28 mm).

With the 14-54 mm zoom lens at 14mm, the moustache distortion were so important that Autopano Pro alone was unable to correct them. The assembling was of poor quality.
With the 11-22 mm zoom lens at 14 mm, the barrel distortions were still there, but they were simple (without moustache) and Autopano Pro could correct them very well and realize a very good assembling.

Correction of optical distortions

For several years I tried any tool allowing to correct optical distortions before assembling. I was never satisfied: DXO, PTLens,... and when Photoshop CS5 was released I had a nice surprise: Lens Correction. However, even if it's a nice surprise when you shoot your photos with a classic lens, it's different wwwith a fisheye lens. Here's why...

Lens correction from Camera Raw 6.1 and next...

Since the CS5 version of Photoshop and 3 of Lightroom, Camera Raw or the module of development come with a new correction tool of the main lenses defects: vignetting, chromaticism and above all distortions. (called Deformation). All of this is part of the workflow in Raw which is a godsend! The sixth tab "Lens corrections" (1) is thus now doubled: the former tab of manual correction and this new tab "Profile" (2) gathering the registered profiles in a database. This base doesn't have all the lenses on the market yet, even though it already has lots but when it's the case, it's very efficient... To know it, you only have to click the button "Activate profile corrections of the lens" (3). If the lens is in the database, the data will appear automatically in the Lens profile (4). And if it's a fisheye lens, you see the image deform right away and become not a fisheye image but an orthoscopic one! The deformation cursor (5) reaches 100 then.Tip! To create virtual tours, you need all the raw material of the photo not to need to shoot two ranges of photos and you should absolutely not correct the fisheye deformation of the photo. EVEN if this tool were to correct both deformations and residual distortions, since you can't select one or the other, I turn the deformation correction off by placing the deformation cursor (5) on 0. So that's why having a fisheye lens that stitches very well is important, because you can still benefit from the automatic correction of vignetting, essential, and of chromaticism, as essential.

Tip! Camera Raw can also develop JPEG files; this distortions, vignetting and chromaticism correction can thus be applied to all your photos!

Fun facts!

I worked for a long time with this Canon 17-40mm lens. There were many advantages and one big drawback. This lens was one of the first Canon lenses to benefit from the new anti-reflective coating from the last lens (towards the sensor), so important in digital photography because digital sensors are way more reflective than films and thus subjects to flare. Secondly, it allowed me to work with two focals I like: the 17 mm and above all, when I'm trying to realize panoramas by assembling, the 35mm. Yet this lens has a big disadvantage: it comes with aspheric lenses creating moustache image distortions! For a long time, I tried different kinds of software such as DXO or PTLens to correct the distortions BEFORE assembling but that was of no use. With Lens Correction, it works! I changed lens ever since but when I'm trying to stitch old photos, I don't have the issues I was facing some time ago.

New! Finally, and paradoxically, at the time when there are finally distortions correction solutions that work, my favourite panorama software Autopano Giga just added in its new version 2.6, an automatic correction of complex distortions that works almost by magic WITHOUT correcting the distortions previously! We really live in a woderful time...!

About efficiency of distortions correction software!

It's impossible to know beforehand if PTLens, Lens Correction or another distortions correction software will or will not be efficient to edit your lens' distortions before assembling in your panorama software. If you get the impression - though real! - to the naked eye that the software is straightening out fine all straight lines from one photo, you notice that the efficiency of this correction, once the photo assembled, is often close to non-existent. This remark is even more accurate if you shot a geometric subject or an interior.
Most of the time indeed, the straightening is only performed to line up the items on one single line or to straighten slightly curved lines. But homothety of the distances on this now corrected straight line isn't respected. The assembling is of poor quality because too complicated to edit in Photoshop hence useless.
There are cases when correction is formidable - even essential - and works perfectly and others when nothing ever comes out of it. To make a high-def, quality assembling, you're thus only left with the option to change lens... unless you're using Autopano Giga / Pro 4.4 which features new assembling algorithms correcting strong distortions, even in cop hat or moustache. It is a major evolution, believe me!

A few examples...

Here are a few examples of pairs digital camera / lens / correction software and what I could note BEFORE the release of Autopano Giga 2.6 (if you use this last version, all pairs can now be assembled, and often perfectly):

Clearly, these remarks are especially valid with the old versions of Autopano Giga (2.5 and previous) and the most part of other assembling pieces of software, often free because with APG 4.4 or PTGui, assembling problems are really more and more unusual.

In the next page, we'll see the basic principles of spherical assembling as well as a list of panorama software -360 panorama assembling

This website is almost entirely free and yet almost free of ads. Why? Because they look so bad! It is lucrative though, and enables many websites to keep on living. So I asked myself: what can I do? To keep on developing this website, I'm going to need a regular income just like everyone else. How can I keep on giving access to free information like I've been doing since April 2002?

And I finally found the answer: affiliation. Every time you click on a link from this site to one of my partners' shops, they know you've been referred by me and give me a small percentage on your purchase, be it something I recommend on my website or anything else. Remember to use my links when you shop on these sites! It doesn't cost you anything and it's a win-win deal – for me, them, and you!