In the project, we are locating the defining area as scale
and rotation invariant
in the map image using SIFT
algorithm and return the coordinates of the matched location.
There are tons of feature detection algorithm such as SIFT
, SURF
, FAST
, BRISK
, ORB
, etc. Acording to tests, SIFT
has low error-rate and better accuracy comparing to others. But, it tooks too much time to execute.
- Quick install prerequisites
pip install -r requirements.txt
- Package version list
python 3.7.13
opencv 4.5.5.64
numpy 1.21.6
matplotlib 3.5.2
python template_matcher.py -h
optional arguments:
-h, --help show this help message and exit
--template TEMPLATE The image to be used as template
--map MAP The image to be searched in
--show Shows result image
--save-dir SAVE_DIR Directory in which you desire to save the result image
Finding the exact location and coordinates of a rotated
part of the satellite map in the satellite map.
python template_matcher.py --template 'examples\satellite-map\eminonu-satellite-map.jpg' --map 'examples\satellite-map\istanbul-satellite-map.jpg' --save-dir 'examples\satellite-map\output-satellite-map.jpg'
Template:
Map:
Result:
Coordinates:
[[[831.315 812.50635]]
[[794.627 748.854 ]]
[[728.32965 786.2521 ]]
[[765.0782 850.3996 ]]]
Finding the exact location and coordinates of a rotated
part of the satellite map in the satellite map.
python template_matcher.py --template 'examples\maidens-tower\maidens-tower.jpg' --map 'examples\maidens-tower\istanbul-map.jpg' --save-dir 'examples\maidens-tower\output-maidens-tower-location.jpg'
Template:
Map:
Result:
Coordinates:
[[[2538.456 1709.4415]]
[[2531.6711 1715.0646]]
[[2558.1897 1709.6547]]
[[2533.1726 1710.5573]]]
Finding the exact location and coordinates of color overlayed
, noised
, and rotated
a part of the star map in the star map.
python template_matcher.py --template 'examples\star-map\area-on-the-sky.jpg' --map 'examples\star-map\star-map.jpg' --show
Template:
Map:
Result:
Coordinates:
[[[390.81454 742.3058 ]]
[[513.85657 933.92474]]
[[755.19464 778.7366 ]]
[[632.2348 587.18396]]]
- Project upgraded
opencv 3.4.2
toopencv 4.5.5.64
- Added quick installation for prerequisites