changeset 697:0421a5a0072c dev

improvemend by Adrien Lessard to choose output homography filename
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 17 Jul 2015 14:22:45 -0400
parents ae137e3b1990
children 8d99a9e16644
files scripts/compute-homography.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/compute-homography.py	Tue Jul 14 00:14:54 2015 -0400
+++ b/scripts/compute-homography.py	Fri Jul 17 14:22:45 2015 -0400
@@ -26,6 +26,7 @@
 parser.add_argument('-w', dest = 'worldFilename', help = 'filename of the aerial photo/ground map')
 parser.add_argument('-n', dest = 'nPoints', help = 'number of corresponding points to input', default = 4, type = int)
 parser.add_argument('-u', dest = 'unitsPerPixel', help = 'number of units per pixel', default = 1., type = float)
+parser.add_argument('-o', dest = 'homographyFilename', help = 'filename of the homography matrix', default = 'homography.txt')
 parser.add_argument('--display', dest = 'displayPoints', help = 'display original and projected points on both images', action = 'store_true')
 parser.add_argument('--intrinsic', dest = 'intrinsicCameraMatrixFilename', help = 'name of the intrinsic camera file')
 parser.add_argument('--distortion-coefficients', dest = 'distortionCoefficients', help = 'distortion coefficients', nargs = '*', type = float)
@@ -113,7 +114,7 @@
     f.close()
 
 if homography.size>0:
-    np.savetxt('homography.txt',homography)
+    np.savetxt(args.homographyFilename,homography)
 
 if args.displayPoints and args.videoFrameFilename is not None and args.worldFilename is not None and homography.size>0 and args.tsaiCameraFilename is None:
     worldImg = cv2.imread(args.worldFilename)