Alignment of XIXth century cadasters: Difference between revisions

From FDHwiki
Jump to navigation Jump to search
Line 25: Line 25:
=== Methods exploration on Berney's cadaster ===  
=== Methods exploration on Berney's cadaster ===  


For the primary research of methods to reattach cadastral maps, the so called ''cadastre Berney'' from Lausanne (1827) has been used, as long as the ground truth for this particular case is known and lot of processing steps (as lines and classes predictions) have already been made. The first exercise has been made on the two first maps, using the lines prediction files. The quandary was to be able to detect the common parts of these two maps, in this case the [https://www.openstreetmap.org/way/37042420#map=18/46.52000/6.63295 ''Rue Pépinet''] and the top of [https://www.openstreetmap.org/way/86932058#map=18/46.51967/6.63198 ''Rue du petit chêne'']. Many different methods have been tested for that task, mainly with help of the openCV python library. The researches have focused on SIFT, General Hough Transform and Template Matching.
For the primary research of methods to reattach cadastral maps, the so called ''cadastre Berney'' from Lausanne (1827) has been used, as long as the ground truth for this particular case is known and lot of processing steps (as lines and classes predictions) have already been made. The first exercise has been made on the two first maps, using the lines prediction files. The quandary was to be able to detect the common parts of these two maps, in this case the [https://www.openstreetmap.org/way/37042420#map=18/46.52000/6.63295 ''Rue Pépinet''] and the top of [https://www.openstreetmap.org/way/86932058#map=18/46.51967/6.63198 ''Rue du petit chêne'']. Many different methods have been tested for that task, mainly with help of the openCV python library. The researches have focused on [https://en.wikipedia.org/wiki/Scale-invariant_feature_transform| scale invariant feature transform (SIFT)], [https://en.wikipedia.org/wiki/Generalised_Hough_transform| General Hough Transform (GHT)]<ref name="ght">Ballard, D. H. (1981). Generalizing the Hough transform to detect arbitrary shapes. In Pattern Recognition (Vol. 13, Issue 2, pp. 111–122). Elsevier BV. doi:[https://doi.org/10.1016/0031-3203(81)90009-1 10.1016/0031-3203(81)90009-1]</ref> and [https://en.wikipedia.org/wiki/Template_matching| Template Matching (TM)].


=== Template matching principle ===
=== Template matching principle ===

Revision as of 22:12, 19 December 2021


Introduction

TODO: Examples of references (APA style)[1], [2].

About a thousand of French napoleonian cadasters have been scanned and need from now to be aligned. A lot of different cities are included in this catalogue as La Rochelle, Bordeaux, Lyon, Lille, Le Havre and also cities that are no longer under French juridiction as Rotterdam.

Similarly to the work that had been done by the Venice Time Machine project, the idea is to attach every maps from a cadaster in order to get a single map of each city.

The main challenge for this project is the automatisation of this process, despite all inconsistencies in the maps, in terms of scale, orientation or conventions. Even if the instructions for the realisation of the maps were quite strict, some differences might last, for example in the scale, if there were nothing to show in some areas, or maps are not always oriented top-north (which is even not always indicated).

Deliverables

- [ ] Tool 
   - [ ] rectification
   - [ ] Alignment
   - [ ] JSON generation
   - [ ] reconstruction of covered areas
- [ ] PoC: La Rochelle downtown

Project setup

Methods exploration on Berney's cadaster

For the primary research of methods to reattach cadastral maps, the so called cadastre Berney from Lausanne (1827) has been used, as long as the ground truth for this particular case is known and lot of processing steps (as lines and classes predictions) have already been made. The first exercise has been made on the two first maps, using the lines prediction files. The quandary was to be able to detect the common parts of these two maps, in this case the Rue Pépinet and the top of Rue du petit chêne. Many different methods have been tested for that task, mainly with help of the openCV python library. The researches have focused on scale invariant feature transform (SIFT), General Hough Transform (GHT)[3] and Template Matching (TM).

Template matching principle

First reattachment of two cadastral maps

The method that gave the most satisfying results (in terms of final output and computation time) was the template matching. The strategy is to cut a template in one of the maps and find the best match in the other one. Attaching the two maps together is then an almost straightforeward task, as long as the lines prediction files are only black (0) or white (255) pixels, and the final result is just the sum of the two of them adapted with the best matching position.



Heatmap of the Template Matching process and detected template on the target image.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


Alignment of Berney's 1827 cadastral maps 001 and 002

Organisation

Timeline summary of first steps

Final milestones of semester

Objective
Week 11 Extract lines on a first set of cadastral maps (La Rochelle or Bordeaux) & manage pipeline
Week 12 Test pipeline on the new extracted lines files
Week 13 Adapt our model or extend it on other cities
Week 14 Final presentation

Automatisation process

Automatic extraction of 9 templates. Best match found is satisfying.
Automatic extraction of 8 templates. Best match found is not satisfying.
- [ ] Trials 
   - [ ] Automatic template extraction
   - [ ] Adjacent cadastres considerations: iterative growth
   - [ ] Taking into account: both orientation and scale
- [ ] Low computational Efficiency
- [ ] Necessity to fine-tune manually parameters due to the lack of a metric closer to human understanding
- [ ] Sometimes poor results (eg. less dense areas, etc.)
- [ ] Too fragile method ?
- [ ] And still time consuming and need close supervision => change of paradigm


After this liminary result, a lot of question were nevertheless still to be answered. For example, is the orientation of our maps precisely in the North direction ? Will it be possible to have an explicit order of maps reattachment ? Will the matching score be as good in the countryside as it was in the city ? Is the scale homogenous within an entire city ? Or what criteria could be used to automatise the template selection ?






Reattachment interface

[ ] Jupyter Innotater
[ ] Rectifying
   [  ] rotation
   [  ] name
   [  ] NOT IMPLEMENTED: scale
[ ] Matching process
   [  ] template selection
   [  ] target selection
   [  ] orientation dependent or not
[ ] Output = "raw" network
[ ] Rebuilding
   [  ] homographies
   [  ] pairwise visualisation
   [  ] area growth
      [  ] new network
      [  ] inverse homographies included
      [  ] shortest path


Visualisation of the template's top left and bottom right corners on the anchor cadastre (left, cadastre E) and their corresponding points on the target cadastre (right, cadastre D).
Network visualisation.
{
    "directed": true,
    "multigraph": false,
    "graph": {},
    "nodes": [{
        "h": int — height of the corresponding image,
        "w": int — width of the corresponding image,
        "label": str — name
    }, {
        "h": int — height of the corresponding image,
        "w": int — width of the corresponding image,
        "label": str — name
    }],
    "match": [{
        "score": float — score of the template matching process,
        "anchor_tl": tuple: two int — coordinate of the template top left corner on the anchor,
        "anchor_br": tuple: two int — coordinate of the template bottom right corner on the anchor,
        "target_tl": tuple: two int — coordinate corresponding to anchor_tl on target,
        "target_br": tuple: two int — coordinate corresponding to anchor_br on target,
        "anchor": str — name of the anchor cadastre\node,
        "target": str — name of the target cadastre\node
    }]
}


Lines detection process

Discussion and limitations

- [ ] Lack of convincing metric / purely qualitative results
- [ ] Failing to automate the task

Why doesn't it work ?

Future Work

- [ ] Tool roadmap
   - [ ] Integration of other matching methods
   - [ ] Integration of more automation (adjacent matching)
   - [ ] improve UX
- [ ] Taking into account matches from all adjacent cadastres and recursive adjustments 
   - [ ] eg. Bundle Adjustment[4]
- [ ] Automation
   - [ ] more heuristic and domain knowledge — in traditional ML/CV methods
   - [ ] investigate "deeper" approaches => add some literature: eg. [5] [6]
- [ ] Alignment on Openstreetmap

References

  1. Bradski, G. (2000). The OpenCV Library. Dr. Dobb's Journal of Software Tools. User site: https://opencv.org
  2. Dan Lester (danlester). (2021). jupyter-innotater. GitHub Repository: https://github.com/ideonate/jupyter-innotater.
  3. Ballard, D. H. (1981). Generalizing the Hough transform to detect arbitrary shapes. In Pattern Recognition (Vol. 13, Issue 2, pp. 111–122). Elsevier BV. doi:10.1016/0031-3203(81)90009-1
  4. Brown, M., & Lowe, D. G. (2007). Automatic panoramic image stitching using invariant features. International journal of computer vision, 74(1), 59-73. doi:10.1007/s11263-006-0002-3
  5. Sun, K., Hu, Y., Song, J., & Zhu, Y. (2021). Aligning geographic entities from historical maps for building knowledge graphs. International Journal of Geographical Information Science, 35(10), 2078-2107. doi:10.1080/13658816.2020.1845702
  6. Duan, W., Chiang, Y.Y., Knoblock, C., Jain, V., Feldman, D., Uhl, J., & Leyk, S. (2017). Automatic Alignment of Geographic Features in Contemporary Vector Data and Historical Maps. In Proceedings of the 1st Workshop on Artificial Intelligence and Deep Learning for Geographic Knowledge Discovery (pp. 45–54). Association for Computing Machinery. doi:10.1145/3149808.3149816