30 July 2014

Photo fun: Using Hugin

Back from my annual month in Italy to lead the excavation at the Vicus Martis Tudertium site and it's time to get cracking on various associated tasks. First up is putting together some of the more adventurous photography work I did, including some pole aerial photography (PAP, as they say, about which I'll do another blog post soon) and 3D work.

For the 3D work, I've been using the for-pay Photoscan application, which works great for me, especially now that I upgraded my laptop to 16GB of RAM. (I'd like to use a freeware option, like VisualSFM, but I can't get it to run yet on my MacBook Pro. I'm working on it now that there's a new installer on GitHub.) The PAP work needs some stitching to create photomosiacs. For that I'm using the freeware Hugin, which is very powerful, but not tremendously well documented, so there's a bit of a learning curve partly due to adapting the old tutorials to the newer versions with their nicer interface.

I already got one photomosaic done during the campaign this summer, just to make sure it was going to work. Here's a small version of the photo. You can catch my feet in more than one place:
It's nothing fancy, just a dry wall, but the technique worked for a ~12m-long stretch, so I've got some more ambitious ones to assemble on. (FYI, the orange things are kids' soccer-field markers that I got to help with aligning the different photos.)

Big inscription from the Roman theater at Ostia Antica.
I'm trying to get up to speed on Hugin's various capabilities in the meanwhile, so I get full use of it. One nice thing it can do is remove various kinds of distortion from photos, including vertical and horizontal effects resulting from your perspective when you take the photo. They call this "Perspective correction". It's fairly simple to do with Hugin and also the kind of thing that's very handy for those of us who take a lot of photos from the ground of big architectural things that therefore end up distorted in the photo. To test it out, I grabbed a photo from Ostia Antica, taken on my last day in Italy this year.


Same inscription corrected.
You can easily see how the nice rectangular inscription shows the expected distortion from being photographed from below. It also has nice straight vertical and horizontal lines, so it's a good object to test the process on.

Following the tutorial, I was able to create a "corrected" version in under half an hour. I used MorphX to create a short video that morphs the original into the final version.

All in all, I'm pretty pleased with the outcome and looking forward to using Hugin with my existing photo collection.

PS In the first version, I incorrectly linked to the "Simulating an architectural projection" tutorial, which is similar, but doesn't include the horizontal correction.