Sunday, November 02, 2008

photo stitching

One thing I like to do sometimes when taking pictures with my digital camera is panoramas. You take a bunch of overlapping pictures from the same spot and later you load them up in your favorite image editor and put them together into one wide panoramic view. That's how it's usually done anyways.

If you are lucky, you may have a camera with panorama stitching capabilities built in. I've never tried such a thing but I'm sure it gives satisfactory results for most (feel free to comment on this with your own experiences). Most of the time though, you will use an image editor and most of the time it will give you decent results. When it doesn't, you usually have the option of 'helping' out and sliding the images around to get a better fit. This is usually the point you discover that the camera wasn't quite as level as it should have been for each shot and no matter how much you play around, you can't get a perfect stitch. And that's just for plain horizontal panoramas. What if you wanted to do some arbitrary stitching of a complete mosaic? You know, take a bunch of pictures horizontally and vertically to capture some great scene in far more detail than you ever could with a single picture. Good luck trying to get them all stitched together.

At least, that's what I would be saying before I found Hugin. This program is certainly the king of all photo stitchers. In fact, it is a cleverly unified collection of a few different photo processing technologies. It is open source and is available for many platforms including windows. Finding an actual windows binary can be a bit tricky so I've provided a link to the current installer here.

This is a powerful program so if you are really interested in using its full potential, you'll have to poke around in the documentation a bit. In the mean time, it has a wizard based option that should give you pretty good results. The only part that confused me a bit was the 'align' stage. The program actually did all the aligning automatically and presented the results in a viewer. It wasn't immediately obvious what I was supposed to do next. I eventually figured out that I could click around the image to set a center point and then adjust the sliders at the edge to trim off the rough edges. There is no 'proceed' or 'next' button here, you just have to close the window and then click on the button for the 3rd and final stage that actually outputs the final image. This will come out as a .tiff file so you will need to load that into your favorite image editor to convert it to something more portable and usable. I suggest saving it as a .png and archive it away somewhere. You can then use this master to create a .jpg or resize it to fit your needs.

I've only scratched the surface on this program so please, download it and try it out for yourself. I can't wait to try some more complicated stitches.

No comments: