Mercurial Hosting > traffic-intelligence
comparison include/cvutils.hpp @ 144:b32947b002da
added the code to read matrices from text files
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 26 Aug 2011 19:38:11 -0400 |
parents | 47329bd16cc0 |
children | 0089fb29cd26 |
comparison
equal
deleted
inserted
replaced
143:436b87d4b992 | 144:b32947b002da |
---|---|
7 class CvCapture; | 7 class CvCapture; |
8 //template<typename T> class Point_<T>; | 8 //template<typename T> class Point_<T>; |
9 | 9 |
10 /// constant that indicates if the image should be flipped | 10 /// constant that indicates if the image should be flipped |
11 //static const int flipImage = CV_CVTIMG_FLIP; | 11 //static const int flipImage = CV_CVTIMG_FLIP; |
12 | |
13 /** Loads a cv mat from a text file where the numbers are saved line by line separated by separator */ | |
14 cv::Mat loadMat(const std::string& filename, const std::string& separator); | |
12 | 15 |
13 template<typename T> | 16 template<typename T> |
14 float scalarProduct(const cv::Point_<T>& v1, const cv::Point_<T>& v2) { return v1.x*v2.x+v1.y*v2.y;} | 17 float scalarProduct(const cv::Point_<T>& v1, const cv::Point_<T>& v2) { return v1.x*v2.x+v1.y*v2.y;} |
15 | 18 |
16 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); | 19 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); |