Mercurial > hg > nsaunier > traffic-intelligence
comparison include/cvutils.hpp @ 614:5e09583275a4
Merged Nicolas/trafficintelligence into default
| author | Mohamed Gomaa <eng.m.gom3a@gmail.com> |
|---|---|
| date | Fri, 05 Dec 2014 12:13:53 -0500 |
| parents | b6ad86ee7033 |
| children | 17e54690af8a 8ac7f61c6e4f |
comparison
equal
deleted
inserted
replaced
| 598:11f96bd08552 | 614:5e09583275a4 |
|---|---|
| 15 cv::Point2f project(const cv::Point2f& p, const cv::Mat& homography); | 15 cv::Point2f project(const cv::Point2f& p, const cv::Mat& homography); |
| 16 | 16 |
| 17 /** Loads a cv mat from a text file where the numbers are saved line by line separated by separator */ | 17 /** Loads a cv mat from a text file where the numbers are saved line by line separated by separator */ |
| 18 cv::Mat loadMat(const std::string& filename, const std::string& separator); | 18 cv::Mat loadMat(const std::string& filename, const std::string& separator); |
| 19 | 19 |
| 20 template<typename T> | 20 //template<typename T> |
| 21 float scalarProduct(const cv::Point_<T>& v1, const cv::Point_<T>& v2) { return v1.x*v2.x+v1.y*v2.y;} | 21 //float scalarProduct(const cv::Point_<T>& v1, const cv::Point_<T>& v2) { return v1.x*v2.x+v1.y*v2.y;} |
| 22 | 22 |
| 23 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); | 23 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); |
| 24 | 24 |
| 25 /** Allocates a new IplImage. */ | 25 /** Allocates a new IplImage. */ |
| 26 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels); | 26 // IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels); |
| 27 | 27 |
| 28 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); | 28 // IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); |
| 29 | 29 |
| 30 /** Goes to the target frame number, by querying frame, | 30 /** Goes to the target frame number, by querying frame, |
| 31 supposing the video input is currently at current frame number. | 31 supposing the video input is currently at current frame number. |
| 32 Returns the frame number that was reached.*/ | 32 Returns the frame number that was reached.*/ |
| 33 int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum); | 33 // int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum); |
| 34 | 34 |
| 35 /// Pre-defined colors | 35 /// Pre-defined colors |
| 36 class Colors { | 36 class Colors { |
| 37 public: | 37 public: |
| 38 static const int nColors = 8; | 38 static const int nColors = 8; |
