diff python/compute-homography.py @ 160:b0719b3ad3db

created function to load point correspondences and updates scripts that use it
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 19 Sep 2011 16:43:28 -0400
parents 4af774bb186d
children ba71924cadf5
line wrap: on
line diff
--- a/python/compute-homography.py	Mon Sep 12 16:38:47 2011 -0400
+++ b/python/compute-homography.py	Mon Sep 19 16:43:28 2011 -0400
@@ -21,9 +21,7 @@
     print('Usage: {0} --help|-h [--video_frame <video frame filename>] [<point_correspondences.txt>]'.format(sys.argv[0]))
     sys.exit()
 
-points = np.loadtxt(args[0], dtype=np.float32)
-srcPts = points[2:,:].T
-dstPts = points[:2,:].T
+dstPts, srcPts = cvutils.loadPointCorrespondences(args[0])
 homography, mask = cv2.findHomography(srcPts, dstPts) # method=0, ransacReprojThreshold=3
 np.savetxt(utils.removeExtension(sys.argv[1])+'-homography.txt',homography)