diff python/cvutils.py @ 152:74b1fc68d4df

re-organized code to avoid cyclic python module dependencies
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 06 Sep 2011 18:44:23 -0400
parents 4af774bb186d
children 668710d4c773
line wrap: on
line diff
--- a/python/cvutils.py	Tue Sep 06 17:55:06 2011 -0400
+++ b/python/cvutils.py	Tue Sep 06 18:44:23 2011 -0400
@@ -58,9 +58,9 @@
     return a
 
 if opencvExists:
-    def arrayToCvMat(a, t = cv.CV_64FC1):
+    def arrayToCvMat(a, t = cv2.cv.CV_64FC1):
         '''Converts a numpy array to an OpenCV CvMat, with default type CV_64FC1.'''
-        cvmat = cv.CreateMat(a.shape[0], a.shape[1], t)
+        cvmat = cv2.cv.CreateMat(a.shape[0], a.shape[1], t)
         for i in range(cvmat.rows):
             for j in range(cvmat.cols):
                 cvmat[i,j] = a[i,j]
@@ -135,7 +135,7 @@
     return invH
 
 if opencvExists:
-    def computeTranslation(img1, img2, img1Points, maxTranslation, minNMatches, windowSize = (5,5), level = 5, criteria = (cv.CV_TERMCRIT_EPS, 0, 0.01)):
+    def computeTranslation(img1, img2, img1Points, maxTranslation, minNMatches, windowSize = (5,5), level = 5, criteria = (cv2.TERM_CRITERIA_EPS, 0, 0.01)):
         '''Computes the translation between of img2 with respect to img1
         (loaded using OpenCV)
         img1Points are used to compute the translation