saeedghsh / Map-Alignment-2D

2D Map Alignment With Region Decomposition
GNU General Public License v3.0
35 stars 11 forks source link
2d alignment decomposition map map-alignment region robotics segmentation subdivision

Map-Alignment-2D

This package has been developed for 2D Map Alignment With Region Decomposition. animate

The following article presents the method:

And Nonrigid Optimization of Multimodal 2D Map Alignment builds on this work.

Dependencies and Download

Download, installing dependencies, and install package

# Download
git clone https://github.com/saeedghsh/Map-Alignment-2D.git
cd Map-Alignment-2D

# Install dependencies
pip install -r requirements.txt

# Install the package [optional]
python setup.py install

Most dependencies are listed in requirements.txt. But there are three more, namely opencv, Polygon and arrangement, which should be installed separately.

Usage Example

For simplicity and convenience, we assume both maps are provided as bitmap (occupancy grid maps). For more examples, see Halmstad Map Collection. Run this:

python demo.py --img_src 'map_sample/map_src.png' --img_dst 'map_sample/map_dst.png' -multiprocessing -visualize

And you should see this: example

Simplified Algorithm (without decomposition and arrangement)

The following psudo-code presents the gist of the alignment algorithm proposed in the paper.

# modeling
1a) perform region segmentation
1b) find the oriented minimum bounding box (OMBB) for each region (e.g. rotating calipers)

# hypotehsis generation
2a) generate hypotheses (affine transformations), by matching every pairs of OMBB from the two maps
2b) reject hypothesis that are non-similarity transformation

# match score and select a winner 
3a) for each hypothesis: find the correspondence between all OMBB from one map to another
3b) calculate the match-score for each hypothesis, and select the one with highest value

Laundry List

License

Distributed with a GNU GENERAL PUBLIC LICENSE; see LICENSE.

Copyright (C) Saeed Gholami Shahbandi