Mercurial > hg > nsaunier > traffic-intelligence
comparison c/cvutils.cpp @ 127:d19d6e63dd77
simple feature tracking and drawing working
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 17 Aug 2011 01:25:13 -0400 |
| parents | 336926453b28 |
| children | 536510f60854 |
comparison
equal
deleted
inserted
replaced
| 126:336926453b28 | 127:d19d6e63dd77 |
|---|---|
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 using namespace std; | 10 using namespace std; |
| 11 using namespace cv; | 11 using namespace cv; |
| 12 | 12 |
| 13 void keypPoints2Points(const vector<KeyPoint>& kpts, vector<Point2f>& points) { | 13 void keyPoints2Points(const vector<KeyPoint>& kpts, vector<Point2f>& pts) { |
| 14 points.clear(); | 14 pts.clear(); |
| 15 points.resize(kpts.size()); | 15 pts.reserve(kpts.size()); |
| 16 | 16 |
| 17 for (unsigned int i=0; i<kpts.size(); i++) | 17 for (unsigned int i=0; i<kpts.size(); i++) |
| 18 points[i] = kpts[i].pt; | 18 pts.push_back(kpts[i].pt); |
| 19 } | 19 } |
| 20 | 20 |
| 21 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} | 21 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} |
| 22 | 22 |
| 23 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { | 23 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { |
