diff python/cvutils.py @ 48:8aed225f71d8

rearranged code for function readline and getlines (and characters), moved invertHomography to cvutils
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 23 Sep 2010 17:24:31 -0400
parents be3ae926e4e8
children 1d36a676c745
line wrap: on
line diff
--- a/python/cvutils.py	Thu Sep 23 17:12:09 2010 -0400
+++ b/python/cvutils.py	Thu Sep 23 17:24:31 2010 -0400
@@ -51,6 +51,13 @@
         projected[1].append(pp[1])
     return projected
 
+def invertHomography(homography):
+    'Returns an inverted homography'
+    from numpy.linalg.linalg import inv
+    invH = inv(homography)
+    invH /= invH[2,2]
+    return invH
+
 class WorldSpaceData:
     '''Simple class for simple intersection outline'''
     def __init__(self, dimension, coordX, coordY):