2 Commits e4c6177bbd ... f683b44659

Author SHA1 Message Date
  Steyer, Nick f683b44659 Add credits 1 year ago
  Steyer, Nick aff5e08b91 Fix cast exception when specifying ransac parameters 1 year ago
1 changed files with 11 additions and 6 deletions
  1. 11 6
      hgcalc.py

+ 11 - 6
hgcalc.py

@@ -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