Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 491:343cfd185ca6
minor changes and reaarrangements
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 16 Apr 2014 17:43:53 -0400 |
parents | f6415f012640 |
children | c81cbd6953fb 935430b1d408 |
comparison
equal
deleted
inserted
replaced
490:60735bd452fc | 491:343cfd185ca6 |
---|---|
375 y = floorY+(positions[1][i]-floorPositions[1][i])*(ceilY-floorY) | 375 y = floorY+(positions[1][i]-floorPositions[1][i])*(ceilY-floorY) |
376 undistortedTrajectory[0].append(x) | 376 undistortedTrajectory[0].append(x) |
377 undistortedTrajectory[1].append(y) | 377 undistortedTrajectory[1].append(y) |
378 return undistortedTrajectory | 378 return undistortedTrajectory |
379 | 379 |
380 def projectGInputPoints(homography, points): | |
381 from numpy import array | |
382 return projectTrajectory(homography, array(points+[points[0]]).T) | |
383 | |
380 if opencvAvailable: | 384 if opencvAvailable: |
381 def computeTranslation(img1, img2, img1Points, maxTranslation2, minNMatches, windowSize = (5,5), level = 5, criteria = (cv2.TERM_CRITERIA_EPS, 0, 0.01)): | 385 def computeTranslation(img1, img2, img1Points, maxTranslation2, minNMatches, windowSize = (5,5), level = 5, criteria = (cv2.TERM_CRITERIA_EPS, 0, 0.01)): |
382 '''Computes the translation of img2 with respect to img1 | 386 '''Computes the translation of img2 with respect to img1 |
383 (loaded using OpenCV as numpy arrays) | 387 (loaded using OpenCV as numpy arrays) |
384 img1Points are used to compute the translation | 388 img1Points are used to compute the translation |