comparison python/cvutils.py @ 233:ab1a11176d7b

initial sqlite code and bug corrected in cvutils
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 04 Jul 2012 16:02:00 -0400
parents b7612c6d5702
children 584613399513
comparison
equal deleted inserted replaced
232:04355e51d895 233:ab1a11176d7b
52 points = loadtxt(filename, delimiter=',') 52 points = loadtxt(filename, delimiter=',')
53 savetxt(utils.removeExtension(filename)+'-point-correspondences.txt',append(points[:,:2].T, points[:,3:].T, axis=0)) 53 savetxt(utils.removeExtension(filename)+'-point-correspondences.txt',append(points[:,:2].T, points[:,3:].T, axis=0))
54 54
55 def loadPointCorrespondences(filename): 55 def loadPointCorrespondences(filename):
56 '''Loads and returns the corresponding points in world (first 2 lines) and image spaces (last 2 lines)''' 56 '''Loads and returns the corresponding points in world (first 2 lines) and image spaces (last 2 lines)'''
57 from numpy.lib.io import loadtxt 57 from numpy.lib.npyio import loadtxt
58 from numpy import float32 58 from numpy import float32
59 points = loadtxt(filename, dtype=float32) 59 points = loadtxt(filename, dtype=float32)
60 return (points[:2,:].T, points[2:,:].T) # (world points, image points) 60 return (points[:2,:].T, points[2:,:].T) # (world points, image points)
61 61
62 def computeHomography(srcPoints, dstPoints, method=0, ransacReprojThreshold=0.0): 62 def computeHomography(srcPoints, dstPoints, method=0, ransacReprojThreshold=0.0):