comparison python/compute-homography.py @ 302:9d88a4d97473

corrected bug in compute-homography
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 18 Mar 2013 23:37:45 -0400
parents be3761a09b20
children
comparison
equal deleted inserted replaced
301:27f06d28036d 302:9d88a4d97473
69 in the same order the corresponding points in world and image spaces. ''') 69 in the same order the corresponding points in world and image spaces. ''')
70 sys.exit() 70 sys.exit()
71 71
72 homography = np.array([]) 72 homography = np.array([])
73 if '-p' in options.keys(): 73 if '-p' in options.keys():
74 worldPts, videoPts = cvutils.loadPointCorrespondences(args[0]) 74 worldPts, videoPts = cvutils.loadPointCorrespondences(options['-p'])
75 homography, mask = cv2.findHomography(videoPts, worldPts) # method=0, ransacReprojThreshold=3 75 homography, mask = cv2.findHomography(videoPts, worldPts) # method=0, ransacReprojThreshold=3
76 elif '-i' in options.keys() and '-w' in options.keys(): 76 elif '-i' in options.keys() and '-w' in options.keys():
77 nPoints = 4 77 nPoints = 4
78 if '-n' in options.keys(): 78 if '-n' in options.keys():
79 nPoints = int(options['-n']) 79 nPoints = int(options['-n'])