Making a Panorama – or a simple stitch

Sometimes, we have the wrong equipment and cannot frame an image correctly. Many would say, well stand closer, or further away. This in principle is fine, but sometimes you get caught out and want to take a ultra wide angle shot, or even just combine two photographs.

What ever your reason is, you do not always need to pay for software in order to get results. This is not a sales pitch or a suggestion that you should delve into software piracy, but instead to point out a free, open-source, cross platform set of tools for achieving great results for free! This software package is called Hugin, and I discovered it after taking a set of about 12 shots of a particle physics detector with my 50mm lens, because, I had left my 28mm at home. I took the shots anyway and then thought… there has to be something out there I can use.

Here I will cover a simple guide on Hugin, the guides online work fine as well, but I thought I’d give it my personal twist. It will by no means supersede the official guides but I think will be more accessible.

So let us say you took these four shots of St George’s Chapel during a trip to Windsor Castle…

dsc_3681

dsc_3682

dsc_3683

dsc_3685

and you want to combine them.

Download Hugin from here http://hugin.sourceforge.net

When you open the application, it will give you some debug messages (depending on the version you get) ignore those, they are not important.

The interface you are looking at is probably the ‘Simple’ interface. This works fine, but i prefer the expert one. So go ahead and select that in the top menu bar. I am working on a mac, but the windows version is similar.

It should look like this

expert_1

Select the Add Image and add each one.

expert_2

So next thing to do is to check that the lens information is correct – it is in this case, the application usually gets it from the information embedded in the image. You will see the letters AC in the Anchor column on the first image.

This is positioning and exposure anchoring, basically which picture should the program say is dead ahead, and which picture should i match the brightness. You can change these by right clicking and selecting the relevant option. For this example I am going to select the second image.

Now the next step depends on the type of image. You now want Hugin to look at each image and find matching features around which it will make the stitch. You can simply press the “Create Control points” button. There are a couple of options, but, typically you want CP find or cpfind + celeste. Hit the button!

For these images, it found 67 for me.

expert_3

Now, next you want to have hugin start laying the images out and to do any trimming down of potential problems. Sometimes it makes a mistake and some control points are bad, or you have lens distortion that causes issues. it is very good practice to remove these distortions using a lens profile and your favourite raw image processor if you are working from original raw files. The images on this page do not contain any such distortion removal… (sorry i was lazy)

So to do this, in the optimize area, the default option is “Positions (Incremental, starting from anchor) Press calculate

expert_4

So we got our result back, this gives a deviation between control points on the different images, here our maximum is 2.15, the average is 0.27, i don’t know if this is in pixels, but the smaller the numbers, the better. So this worked quite well. Apply the changes. If something is drastically bad you may highlight all the images, right click and in the menu select clean control points. It will go through and remove the ones that don’t seem to work. In drastic cases you will need to go to the control points tab, and click through the image comparisons and figure out which control points are bad and remove them by hand. Here though, all looks good!

You can further optimize things by including more parameters from the optimize geometric options. The last one including things like rotation, zoom, barrel distortions, lots of good stuff. If you select that and hit calculate once again, the maximum deviation decreases to 0.8 in my case. This means that when I took the shot, I moved in a way that was none circular or i stepped to one side a little. Either way, the optimizer appears to have fixed it.

Now press the fast preview icon, it has the letters GL in it. The simple interface will pop up and show you what the panorama looks like. Press the stitch tab on the expert control windows and you will see the following screen.

expert_5

Now, press Calculate field of view. The image on the preview should get bigger and roughly fill the whole black space.
Press Calculate optimal size, the canvas size will now reflect the actual stitched image size, yep, they can be huge!
Finally press Fit Crop to images

We now have this
expert_6

So now you can note how the program has stretched the images and overlayed them, you can also see how the exposure on one of the images is slightly higher, dont worry about this, the program will take care of that. In most cases that is…

Press Stitch, a dialogue will pop up, select your save names and off we go. Depending on your computer, it will now take a few seconds, or a few minutes.

Now check out the result (i have resized it)

dsc_3681-dsc_3685

Not bad! You can see some perspective distortion, but other than that, it looks like hugin did an excellent job!

Hugin will do other nice things, in the Masks tab, you can select parts of images you want to include or exclude… this is wonderful as it allows you to take several images of something such as a monument with tourists walking around. With enough shots, you can exclude everyone in all of the images and end up with a stacked image that looks like you took the shot when the place was deserted.

The Control points tab allows you to add or remove control points and change their locations. This is very useful if you have a problematic image and need to nurse it through the process.

With enough care you can do many things with this program!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: