Mercurial Hosting > traffic-intelligence
comparison python/cvutils.py @ 547:97c5fef5b2d6
corrected bugs
author | MohamedGomaa |
---|---|
date | Tue, 08 Jul 2014 13:43:56 -0400 |
parents | bd1ad468e928 |
children | e6ab4caf359c |
comparison
equal
deleted
inserted
replaced
546:6c0923f1ce68 | 547:97c5fef5b2d6 |
---|---|
346 if (homography!=None) and homography.size>0: | 346 if (homography!=None) and homography.size>0: |
347 augmentedPoints = append(points,[[1]*points.shape[1]], 0) | 347 augmentedPoints = append(points,[[1]*points.shape[1]], 0) |
348 prod = dot(homography, augmentedPoints) | 348 prod = dot(homography, augmentedPoints) |
349 return prod[0:2]/prod[2] | 349 return prod[0:2]/prod[2] |
350 else: | 350 else: |
351 return p | 351 return points |
352 | 352 |
353 def project(homography, p): | 353 def project(homography, p): |
354 '''Returns the coordinates of the projection of the point p with coordinates p[0], p[1] | 354 '''Returns the coordinates of the projection of the point p with coordinates p[0], p[1] |
355 through homography''' | 355 through homography''' |
356 from numpy import array | 356 from numpy import array |