Monday, March 2nd 2015
Modern cameras are exceedingly flexible and allow you to use a wide variety of lenses to capture scenes of various dimensions. I imagine, though, that despite this, every photographer from time to time laments the inability of the camera to capture a very wide scene, for example a sweeping landscape or a parade. Presented with such a subject what is one to do?
Being all too familiar with this dilemma, I was very excited to discover that my new camera (a Panasonic Lumix DMC-G6) offered a panorama function. To use it, you select the appropriate setting on the camera, press the exposure button and sweep the camera slowly from left to right. You can let it run until it stops by itself or you can stop it yourself by pressing the button. You need to sweep at the right speed because if you move too slowly or too fast the camera aborts the operation with a warning message. Here is an example from a previous post:
This works well for scenes, such as landscapes, where you are standing at a distance from the subject. If you are close to your subject, however, then lens distortion comes into play.
The distortion may be mild, as in the above photo of King’s Cross Station, or…
…it can be so severe that I am disinclined to use the photo.
Admittedly, there do exist photo editing applications that are claimed to be able to correct lens and perspective distortion but, in my experience, they are very much a last resort and do not produce good results. They work by allowing you to stretch the image this way or that as you might a rubber sheet. The problem is that in order to correct one part of the photo, you have to distort another part. That might work if, for example, you want only the central part of the photo and can afford to crop off the now distorted outer regions. If, on the other hand, you are trying to save the whole photo, then you are very unlikely to succeed.
So, what’s the answer?
Thinking about this took me back to a time before I had the new camera and was using one that didn’t have a panorama function. I had then been thinking of getting hold of some stitching software in order to combine several photos into one. I had not persevered with the idea then but it had now come back to haunt me. My idea was this: What if, instead of using the panorama function, I took a set of overlapping photos and used software to stitch these together? Would the result be a panorama without the distortion?
There was one obvious way to answer the question: try it!
To do so, I needed some photos to use as experimental subjects. For the first batch I cheated by taking a panorama and cutting it into three overlapping sections:
As my second batch, I used four single photos that I had taken of the street art on the wall of the Wheelbarrow in Camden Town. I hoped there would be enough overlap in these to allow the software to stitch them together.
I now needed to find some software to stitch the photos together. Here I ran into a problem of terminology. I first searched for “photo stitching” software and ended up with a lot of programs (and online sites) that merely join the photos together, end to end, which is not what I wanted. The term to search for, then is “photo panorama stitching” software. Once I’d tumbled to this, I found a range of choices.
The first one I tried is Autostitch which is free and doesn’t need installing: just unzip the downloaded file and double click on the exe file. It presents you with three buttons (load, run and settings) and is very easy to use. The version of Homerton Hospital that it produced was almost perfect although the edges are not straight and would need trimming. You might like to compare it with the original panorama version above.
Here is what Autostitch made of the four sections of the Wheelbarrow pub wall.
It has stitched the photos together perfectly but the first thing you notice is the distortion. It’s as though the picture is on a card that has bellied out towards the back, introducing a curved perspective and causing the left and right edges to lean inwards. This is like the distortion introduced by my camera’s panorama function but in reverse! While I thought that this might do, if I were desperate, I wondered whether I could do better.
The second one I tried is ICE – Image Composite Editor by Microsoft Research. It is available in 64-bit and 32-bit editions. It too is easy to use once you work out the disk icon at top left is not for saving the composite photo but for saving the “project” (the job you are currently doing) and that to save the picture you have to use “Export to disk” at stage 4 of the operation.
Here is how ICE performed with the Homerton Hospital fragments.
The result is pretty good. In fact it is virtually indistinguishable from the original picture. There are no rough edges or distortion. Another good thing is that by default ICE keeps the photos at the original size, whereas Autostitch reduces them (it may be possible to specify the size in Autostitch but I haven’t investigated this).
Now for the more difficult task, that of combining four separate images.
Here we do have some ragged borders and a leaning right edge but I am happy to accept that this is largely because of the way the photos were taken: I took no special care to make them compatible as I didn’t expect to be stitching them. It is a far more competent result than that achieved by Autostitch.
For the time being at least, I shall be adopting ICE as my photo stitcher. When taking photos that I intend to stitch, I will be careful to leave plenty of space around the subject to allow for trimming off the black jagged edges. I think that in some circumstances, for example when I am close to the subject, stitching multiple images with ICE will give better results than using the camera’s panorama setting.