4
\$\begingroup\$

I am trying to stitch together screenshots of a map, so that I can get a higher resolution version of it to later vectorize and work with. The screenshots will have to be aligned in a grid of 3x3 or 4x4. They all have the same orientation and zoom level, and all overlap by a fair bit. However I am having trouble doing this job in Hugin.

I tried following the Hugin tutorial on Snitching flat scanned images, but I wasn't able to get the pictures to align correctly. So, how do I do this? Thank you.

\$\endgroup\$
4
  • \$\begingroup\$ 1. Screenshots of a map is not photography. 2. A full tutorial on how to use Hugin is too broad. 3. Hugin is not the right tool because there is no need to remap the projection in screenshots of a flat larger image. Just put the images in separate layers of a larger canvas and move them around until they're lined up. \$\endgroup\$
    – xiota
    Nov 2, 2019 at 5:51
  • 3
    \$\begingroup\$ Thank you for taking the time to point out what's wrong with my question. I asked my question here because here is where I saw most discussions about the Hugin software. I never asked for a full tutorial, just what settings to pay attention to in order to get the desired result. I imagined that there would have been better alternatives than Hugin, and that's why I asked for other FOSS as well. I was looking for an automated tool because I want to make several of these images. Where do you think is appropriate to ask my question? Thank you again. \$\endgroup\$
    – itsmeciao
    Nov 2, 2019 at 13:12
  • \$\begingroup\$ Hugin is probably the "only game in town" for automated FOSS stitching. There are many possibilities for why a set of images might not align properly. It could be the input images, control points, or other settings. More information is needed to figure out the cause in your case. \$\endgroup\$
    – xiota
    Nov 2, 2019 at 18:38
  • 3
    \$\begingroup\$ I was editing my question with steps to reproduce, but then found what was wrong and so I went ahead and wrote an answer. Thank you again for wanting to help. \$\endgroup\$
    – itsmeciao
    Nov 3, 2019 at 3:04

3 Answers 3

7
\$\begingroup\$

After some more studying the program and testing around I finally got it to work! Here is every step I took:

  • Launch Hugin (version 2019.0.0.a369cbe55179, on Manjaro Linux);
  • Interface menu > Expert;
  • In the Photos tab, add images (In my case they are a 3x4 grid, all are 1920x1080, but I have also tried a set of images that don't have a clear shape after stitching). When asked, I set 1 as HFOV and leave Normal (rectilinear) as lens type;
  • I set one of the central images as anchor by right clicking in the image and choosing Anchor this image for position/exposure, then proceed to right click on every image except the first one and choose Lens > New lens. I also go in Optimise > Geometric and choose Custom parameters;
  • Switch to the Control points tab and let Hugin's engine (default Hugin's CPFind) detect control points between pairs of images. I also make sure that every image has CPs with images overlapping from top/bottom, left/right and angles (is this necessary or overkill?). After every run of CPFind, I check for false positives, a quick way is to compare the distances of every cp, in my case they all match except the false positives;
  • In the Optimiser tab, I unselect all Yaw, Pitch and Roll, and select all X and Y (the anchor has nothing active). Under Lens Parameters I select all Hvof (v). Then click on Optimise now! and apply the changes;
  • Open the Preview panorama window and choose Straighten, you should be able to see the stitched image at this point;
  • Open the Stitcher tab, click on Calculate Optimal Size and Fit Crop to Images, eventually choose your format and other settings, and Stitch!

I couldn't get it to work before because the tutorial that I was following, Stitching flat scanned images, suggested to also activate all Z in the Optimiser tab, or alternatively all Roll and under Lens Parameters all Hfov, d, e.

I hope that this will be useful to someone in the future.

\$\endgroup\$
1
  • \$\begingroup\$ +1 A few comments: about step 3 - set HFOV to 10 instead of 1 worked better for my case; step 4 - you can select all images before right clicking to change lens, but I'm not sure this step is even needed; steps 4 & 5 - the (perhaps new) Optimize > Geometric option "Positions (incremental..." seems to more easily achieve the same result. \$\endgroup\$
    – stafusa
    Nov 19, 2021 at 11:24
1
\$\begingroup\$

The 'Optimise > Geometric and choose Custom parameters' is very important as otherwise the 'Optimiser' tab is not shown and the menu option is greyed out without explanation.

To set it, go to the 'Photos' tab, then near the bottom is an 'Optimise' section. Set 'Geometric' to 'Custom parameters' and the Optimiser tab should appear.

\$\endgroup\$
0
\$\begingroup\$

In more recent versions of Hugin (I'm using 2022.0.0.9bb147ae7161 built by Thomas), having loaded the images you can simply select "Scanned images" when aligning:

enter image description here

This worked flawlessly for me to stitch together several top-down photos of parts of a map into a single "panorama" of the complete map, virtually scanning it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.