comparison python/cvutils.py @ 63:40e8e3bb3702

corrected projection bugs
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 05 Nov 2010 11:07:31 -0400
parents 1d36a676c745
children b85912ab4064
comparison
equal deleted inserted replaced
62:290fceb125d2 63:40e8e3bb3702
29 through homography''' 29 through homography'''
30 from numpy.core._dotblas import dot 30 from numpy.core._dotblas import dot
31 from numpy.core.multiarray import array 31 from numpy.core.multiarray import array
32 from numpy.lib.function_base import insert 32 from numpy.lib.function_base import insert
33 if (homography!=None) and (len(homography)>0): 33 if (homography!=None) and (len(homography)>0):
34 pAugmented = insert(array(p.aslist()), [2],[1], axis=0) 34 pAugmented = insert(array(p), [2],[1], axis=0)
35 tmp = dot(homography, pAugmented) 35 tmp = dot(homography, pAugmented)
36 return Point(tmp[0]/tmp[2], tmp[1]/tmp[2]) 36 return [tmp[0]/tmp[2], tmp[1]/tmp[2]]
37 else: 37 else:
38 return p 38 return p
39 39
40 def projectTrajectory(homography, trajectory): 40 def projectTrajectory(homography, trajectory):
41 '''Projects a series of points in the format 41 '''Projects a series of points in the format