Mercurial Hosting > traffic-intelligence
diff 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 |
line wrap: on
line diff
--- a/include/cvutils.hpp Wed Aug 24 19:43:44 2011 -0400 +++ b/include/cvutils.hpp Fri Aug 26 19:38:11 2011 -0400 @@ -10,6 +10,9 @@ /// constant that indicates if the image should be flipped //static const int flipImage = CV_CVTIMG_FLIP; +/** Loads a cv mat from a text file where the numbers are saved line by line separated by separator */ +cv::Mat loadMat(const std::string& filename, const std::string& separator); + template<typename T> float scalarProduct(const cv::Point_<T>& v1, const cv::Point_<T>& v2) { return v1.x*v2.x+v1.y*v2.y;}