forked from pablofdezalc/akaze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_akaze_programs.py
39 lines (33 loc) · 1.39 KB
/
test_akaze_programs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import sys
import os
import subprocess
# ===============================================================================
# Populate AKAZE-based programs
programs = ['AKAZE_features', 'AKAZE_match', 'AKAZE_compare']
for i in range(len(programs)):
programs[i] = './bin/Release/' + programs[i]
if sys.platform == 'win32':
for i in range(len(programs)):
programs[i] = programs[i] + '.exe'
# ===============================================================================
# Helper functions
def extract_AKAZE_features(imagePath):
command = " ".join([programs[0], ' -i ', imagePath])
os.system(command)
def match_AKAZE_features(imagePath1, imagePath2, gdTruthHomography):
command = " ".join(
[programs[1], ' -L ', imagePath1, ' -R ', imagePath2, ' -H ', gdTruthHomography] )
os.system(command)
def compare_AKAZE_BRISK_ORB(imagePath1, imagePath2, gdTruthHomography):
command = " ".join(
[programs[2], ' -L ', imagePath1, ' -R ', imagePath2, ' -H ', gdTruthHomography] )
os.system(command)
# ===============================================================================
# Example datasets
imagePath1 = './datasets/iguazu/img1.pgm'
imagePath2 = './datasets/iguazu/img4.pgm'
gdTruthHomography = './datasets/iguazu/H1to4p'
# Go!
extract_AKAZE_features(imagePath1)
match_AKAZE_features(imagePath1, imagePath2, gdTruthHomography)
compare_AKAZE_BRISK_ORB(imagePath1, imagePath2, gdTruthHomography)