comparison include/testutils.hpp @ 201:f7ddfc4aeb1e

added tests for graphs
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 05 Mar 2012 01:52:56 -0500
parents aeab0b88c9b6
children 045d05cef9d0
comparison
equal deleted inserted replaced
200:0a27fa343257 201:f7ddfc4aeb1e
5 5
6 #include "opencv2/core/core.hpp" 6 #include "opencv2/core/core.hpp"
7 7
8 #include <boost/shared_ptr.hpp> 8 #include <boost/shared_ptr.hpp>
9 9
10 inline boost::shared_ptr<FeatureTrajectory> createFeatureTrajectory(const int& firstInstant, const int& lastInstant, const cv::Point2f& firstPosition, const cv::Point2f& velocity) { 10 inline boost::shared_ptr<FeatureTrajectory> createFeatureTrajectory(const unsigned int& id, const unsigned int& firstInstant, const unsigned int& lastInstant, const cv::Point2f& firstPosition, const cv::Point2f& velocity) {
11 cv::Mat emptyHomography; 11 cv::Mat emptyHomography;
12 boost::shared_ptr<FeatureTrajectory> t = boost::shared_ptr<FeatureTrajectory>(new FeatureTrajectory(firstInstant, firstPosition, emptyHomography)); 12 boost::shared_ptr<FeatureTrajectory> t = boost::shared_ptr<FeatureTrajectory>(new FeatureTrajectory(firstInstant, firstPosition, emptyHomography));
13 cv::Point2f p = firstPosition; 13 cv::Point2f p = firstPosition;
14 for (int i=firstInstant+1; i<=lastInstant; ++i) { 14 for (unsigned int i=firstInstant+1; i<=lastInstant; ++i) {
15 p = p+velocity; 15 p = p+velocity;
16 t->addPoint(i, p, emptyHomography); 16 t->addPoint(i, p, emptyHomography);
17 } 17 }
18 t->setId(id);
18 return t; 19 return t;
19 } 20 }
20 21
21 #endif 22 #endif