Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 223:c31722fcc9de
minor modifications for integer drawing in OpenCV
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 26 Jun 2012 03:29:57 -0400 |
| parents | 9c7fc6899c0e |
| children | e0988a8ace0c |
comparison
equal
deleted
inserted
replaced
| 222:426321b46e44 | 223:c31722fcc9de |
|---|---|
| 156 def aslist(self): | 156 def aslist(self): |
| 157 return [self.x, self.y] | 157 return [self.x, self.y] |
| 158 | 158 |
| 159 def astuple(self): | 159 def astuple(self): |
| 160 return (self.x, self.y) | 160 return (self.x, self.y) |
| 161 | |
| 162 def asint(self): | |
| 163 return Point(int(self.x), int(self.y)) | |
| 161 | 164 |
| 162 def project(self, homography): | 165 def project(self, homography): |
| 163 from numpy.core.multiarray import array | 166 from numpy.core.multiarray import array |
| 164 projected = cvutils.projectArray(homography, array([[self.x], [self.y]])) | 167 projected = cvutils.projectArray(homography, array([[self.x], [self.y]])) |
| 165 return Point(projected[0], projected[1]) | 168 return Point(projected[0], projected[1]) |
