Build a slippy map from photographs of a series of paper maps
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
images
.gitignore
LICENSE
README.md
findMapInPageBatch.py
findMapInPageSingle.py
run.sh

README.md

huckathon-autogeoref

This is a workflow that I used to automatically create this continuous slippy map from a collection of 144 1960's map sheets using computer vision. iFrames are not allowed in readme files, or I would put the demo here here is a static image instead, click it to see the real one:

screenshot

The map is composed of photographs of 144 map sheets. The images were corrected for barrel distortion using ImageMagick and the map frames were automatically detected in the image using the map using OpenCV:

cv demo

The frames were then extracted and corrected for perspective distortion:

extracted map

and then cropped to remove the border:

cropped map

finally, the software uses GDAL to georeference the files, mosaic into a VRT and then cut into tiles to be served to the leaflet map above. Colour balancing is attempted using rastrio.


Usage and Dependencies

This code is only intended to demonstrate the workflow that I used, it is designed for the particular map collection that I was working with and not for ease of transferability. That said, I would expect that it would be quite simple to apply it to other map collections. To use this for your own map collection, you would probably need to do little more than edit the barrel distortion values for your camera lens / focal length and edit the gridToCoords() function, which is used to work out the coordinates for the image based upon the file name (which described the grid square in my case). You might need to adjust the parameters in some of the computer vision and image processing functions (particularly the crop size, for example), but this should be quite easy to achieve through trial and error.

To actually run the software, simply run run.sh in the terminal.

These are the dependencies upon which the software is built:

Maps

The demo images are out-of-copyright images or Northern Uganda produced by the Ordnance Survey in the 1960's. The maps were supplied courtesy of University of Manchester Library Special Collections.

Acknowledgements

Grateful thanks to Donna Sherman for organising access to the maps and to Nick Scarle for taking and pre-processing the photographs (and getting a very sore arm in the process!).