Mercurial Hosting > traffic-intelligence
changeset 384:6da9cf5609aa
adding deprecated messages if old cvmat format
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 22 Jul 2013 18:11:01 -0400 |
parents | 0ce2210790b1 |
children | 1917db662aa7 |
files | python/cvutils.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/python/cvutils.py Mon Jul 22 11:46:35 2013 -0400 +++ b/python/cvutils.py Mon Jul 22 18:11:01 2013 -0400 @@ -70,6 +70,7 @@ def cvMatToArray(cvmat): '''Converts an OpenCV CvMat to numpy array.''' + print('Deprecated, use new interface') from numpy.core.multiarray import zeros a = zeros((cvmat.rows, cvmat.cols))#array([[0.0]*cvmat.width]*cvmat.height) for i in xrange(cvmat.rows): @@ -85,6 +86,7 @@ def arrayToCvMat(a, t = cv2.cv.CV_64FC1): '''Converts a numpy array to an OpenCV CvMat, with default type CV_64FC1.''' + print('Deprecated, use new interface') cvmat = cv2.cv.CreateMat(a.shape[0], a.shape[1], t) for i in range(cvmat.rows): for j in range(cvmat.cols): @@ -180,14 +182,15 @@ def printCvMat(cvmat, out = stdout): '''Prints the cvmat to out''' + print('Deprecated, use new interface') for i in xrange(cvmat.rows): for j in xrange(cvmat.cols): out.write('{0} '.format(cvmat[i,j])) out.write('\n') def projectArray(homography, points): - '''Returns the coordinates of the projected points (format 2xN points) - through homography''' + '''Returns the coordinates of the projected points through homography + (format: array 2xN points)''' from numpy.core import dot from numpy.core.multiarray import array from numpy.lib.function_base import append @@ -216,7 +219,8 @@ return projectArray(homography, array(trajectory)) def invertHomography(homography): - 'Returns an inverted homography' + '''Returns an inverted homography + Unnecessary for reprojection over camera image''' from numpy.linalg.linalg import inv invH = inv(homography) invH /= invH[2,2]