|
@@ -3,6 +3,11 @@ import sys
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
+"""
|
|
|
+Adapted from the homework assignment from Computer Vision I by Stefan Roth
|
|
|
+Teaching assistants Shweta Mahajan and Krishnakant Singh
|
|
|
+From the solution of group 22 (Merve Bektas, Danail Iordanov and Nick Steyer)
|
|
|
+"""
|
|
|
|
|
|
def ransac_iters(p, k, z):
|
|
|
""" Computes the required number of iterations for RANSAC.
|
|
@@ -447,14 +452,14 @@ def main():
|
|
|
z = 0.99 # total probability of success after all iterations
|
|
|
|
|
|
if len(sys.argv) == 3:
|
|
|
- threshold = sys.argv[2]
|
|
|
+ threshold = float(sys.argv[2])
|
|
|
elif len(sys.argv) == 4:
|
|
|
- threshold = sys.argv[2]
|
|
|
- p = sys.argv[3]
|
|
|
+ threshold = float(sys.argv[2])
|
|
|
+ p = float(sys.argv[3])
|
|
|
elif len(sys.argv) == 5:
|
|
|
- threshold = sys.argv[2]
|
|
|
- p = sys.argv[3]
|
|
|
- z = sys.argv[4]
|
|
|
+ threshold = float(sys.argv[2])
|
|
|
+ p = float(sys.argv[3])
|
|
|
+ z = float(sys.argv[4])
|
|
|
elif len(sys.argv) != 2:
|
|
|
print('Usage: hgcalc <pairs_file_path> [threshold [valid_correspondence_probability [total_probability]]]')
|
|
|
return
|