comparison include/testutils.hpp @ 196:aeab0b88c9b6

began testing of FeatureGraph
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 20 Dec 2011 00:31:37 -0500
parents
children f7ddfc4aeb1e
comparison
equal deleted inserted replaced
195:1247e26a8b5e 196:aeab0b88c9b6
1 #ifndef TEST_UTILS_HPP
2 #define TEST_UTILS_HPP
3
4 #include "Motion.hpp"
5
6 #include "opencv2/core/core.hpp"
7
8 #include <boost/shared_ptr.hpp>
9
10 inline boost::shared_ptr<FeatureTrajectory> createFeatureTrajectory(const int& firstInstant, const int& lastInstant, const cv::Point2f& firstPosition, const cv::Point2f& velocity) {
11 cv::Mat emptyHomography;
12 boost::shared_ptr<FeatureTrajectory> t = boost::shared_ptr<FeatureTrajectory>(new FeatureTrajectory(firstInstant, firstPosition, emptyHomography));
13 cv::Point2f p = firstPosition;
14 for (int i=firstInstant+1; i<=lastInstant; ++i) {
15 p = p+velocity;
16 t->addPoint(i, p, emptyHomography);
17 }
18 return t;
19 }
20
21 #endif