Mercurial Hosting > traffic-intelligence
diff c/cvutils.cpp @ 804:17e54690af8a dev
work in progress, not fully functional yet
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 01 Jun 2016 17:57:49 -0400 |
parents | f7cf43b5ad3b |
children |
line wrap: on
line diff
--- a/c/cvutils.cpp Wed Jun 01 01:55:45 2016 -0400 +++ b/c/cvutils.cpp Wed Jun 01 17:57:49 2016 -0400 @@ -11,19 +11,18 @@ using namespace std; using namespace cv; -Point2f project(const Point2f& p, const Mat& homography) { - //Mat homogeneous(3, 1, CV_32FC1); - float x, y; - float w = homography.at<float>(2,0)*p.x+homography.at<float>(2,1)*p.y+homography.at<float>(2,2); - if (w != 0) { - x = (homography.at<float>(0,0)*p.x+homography.at<float>(0,1)*p.y+homography.at<float>(0,2))/w; - y = (homography.at<float>(1,0)*p.x+homography.at<float>(1,1)*p.y+homography.at<float>(1,2))/w; - } else { - x = 0; - y = 0; - } - return Point2f(x, y); -} +// Point2f project(const Point2f& p, const Mat& homography) { +// float x, y; +// float w = homography.at<float>(2,0)*p.x+homography.at<float>(2,1)*p.y+homography.at<float>(2,2); +// if (w != 0) { +// x = (homography.at<float>(0,0)*p.x+homography.at<float>(0,1)*p.y+homography.at<float>(0,2))/w; +// y = (homography.at<float>(1,0)*p.x+homography.at<float>(1,1)*p.y+homography.at<float>(1,2))/w; +// } else { +// x = 0; +// y = 0; +// } +// return Point2f(x, y); +// } Mat loadMat(const string& filename, const string& separator) { vector<vector<float> > numbers = ::loadNumbers(filename, separator);