-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathtest_akaze_programs.py
36 lines (30 loc) · 1.35 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
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] = os.path.join('.', 'bin' , 'Release' , programs[i])
# ===============================================================================
# Helper functions
def extract_AKAZE_features(imagePath):
command = " ".join([programs[0], ' ', imagePath])
os.system(command)
def match_AKAZE_features(imagePath1, imagePath2, gdTruthHomography):
command = " ".join(
[programs[1], ' ', imagePath1, ' ', imagePath2, ' ', gdTruthHomography] )
os.system(command)
def compare_AKAZE_BRISK_ORB(imagePath1, imagePath2, gdTruthHomography):
command = " ".join(
[programs[2], ' ', imagePath1, ' ', imagePath2, ' ', gdTruthHomography] )
os.system(command)
# ===============================================================================
# Example datasets
imagePath1 = os.path.join('.','datasets','iguazu', 'img1.pgm')
imagePath2 = os.path.join('.','datasets','iguazu', 'img4.pgm')
gdTruthHomography = os.path.join('.','datasets','iguazu', 'H1to4p')
# Go!
extract_AKAZE_features(imagePath1)
match_AKAZE_features(imagePath1, imagePath2, gdTruthHomography)
compare_AKAZE_BRISK_ORB(imagePath1, imagePath2, gdTruthHomography)