How to recreate a paper map from photos using Hugin software | Gwulo: Old Hong Kong

How to recreate a paper map from photos using Hugin software

If you take several photos of a large map and want to reassemble them into a single image, the Hugin application can help: http://hugin.sourceforge.net/

Here is my workflow.

1. Prepare

  • Get the map as flat as possible. You'll probably need some heavy items around the edges, especially if was kept rolled.
  • Get the best lighting you can: bright, even, and without shadows.

2. Take photos

  • Try to keep the camera at the same distance above the map, and perpendicular to the map surface, for all shots
  • Check you're close enough, and focused well, so that all text is sharp
  • Make sure there is a good (30-50%) overlap between shots.
  • After taking all the photos, check there aren't any that are blurred. It's a lot easier to retake them now than having to schedule a second trip to the archive!

3. Rebuild the map sheet(s) using Hugin.

If the map is made up from several sheets, split the photos into separate directories, one per sheet, and make one Hugin project per sheet. Then for each project...

  • Start by adding a photo taken near the centre of the map
  • On the "Photos" tab, set the Optimize >> Geometric:  option to "Custom parameters"
  • On the "Stitcher" tab set the Project: to Rectilinear
  • Add another photo that overlaps
    • add control points to link it to the earlier photos
      • Remember to add control points for horizontal and vertical lines when possible, both for the new photo, and between it and earlier photos
    • On the " Optimizer" tab:
      • untick Yaw, Pitch, and Roll, and make sure all their values are set to zero
      • tick X, Y, Z (ie we assume the camera was in the same orientation for each photo, and just let Hugin slide the tiles around to get the best overlap)
      • Click "Optimize now!"
    • Use "View" >> "Fast panorama preview window" to check it's looking ok
    • Repeat until all photos are added
  • Once all the photos are added and looking good, go back to the "Optimizer" tab and for each photo:
    • tick Yaw, Pitch, and Roll (now we let Hugin adjust for slight differences in camera was in the same orientation between photos. If we try this earlier, Hugin can choose some odd values that break the map up.)
    • Click "Optimize now!"
    • Check it made things better
    • Repeat for the next photo
  • Then for each photo:
    • tick "Plane yaw" and "Plane pitch" (if you see "Camera translation" gets ticked automatically, that's ok)
    • Click "Optimize now!"
    • Check it made things better
    • Repeat for the next photo
  • Finally on the "Optimizer" tab, tick the Lens Parameters one by one, optimizing after each and checking it improves things
  • Go to the "Stitcher" tab
    • Projection: Rectilinear
    • Click Calculate field of view, then Calculate optimal size, then Fit crop to images
    • Tick Panorama Outputs: >> Exposure fused from any arrangement
    • Tick Layers: >> Blended layers of similar exposure, without exposure correction
    • Click "Stitch!" button
  • This will create a TIFF file of the merged images, plus copies of the individual images Hugin used to create it
    • Check the TIFF file to see that the alignment is good. If there's a place where parts of the image don't line up well - eg you see a break in a road - there are couple of likely problems & fixes:
      • You've got a bad control point pair. This is an easy mistake to make - you thought you added points to the same landmark on both images, but in fact they're pointing at two different locations. The easy way to spot this is to go to the control points page and sort on the distance column. Then go through each set of control points, looking at the points with the worst (highest) values for distance. Check any that have a distance > 10, and make corrections as necessary.
      • Hugin needs more control points to do its job. Add more control points around the area where the images don't align well to help Hugin do a better job.
    • After making the changes, optimise and stitch again and see if the new TIFF looks better. You may need to repeat this cycle several times.
  • Go to File >> Save to save the settings in case you need to use them again.

4. Edit the sheet

I use Photoshop, but just use your preferred image editor.

  • Check the image is as sharp as possible.
    • In some cases Hugin may have chosen an image that isn't the sharpest. In that case overwrite that section using the better image. (Use the copy of the image that Hugin created at the end of step 3.)
    • Also look at whether a sharpen filter makes it better
  • Adjust levels
  • Save
  • Crop away any extra outside the edges of the sheet

5. If there were more than one sheet, join them together using your preferred image editor.

Forum: 

I have just watched your video on reading maps. What a great tutorial. Thanks.

You mentioned the software package Hugin for stitching maps. Sounds like just what I have been looking for.  I have diwnloaded and installed it, but can't find a way to start it. It doesn't show up on my deskto and I can't see any exe file in the Program Files folder.

Probably something simple I just can;t see. Help please.

John

After installing Hugin on my Windows 10 PC, I was just able to hit the Windows key, start typing Hugin, and Windows shows "Hugin - Panorama Editor" in the results.

If you're still having trouble with it, I recommend you ask for help at their support page: https://launchpad.net/hugin

Regards, David