Mercurial Hosting > traffic-intelligence
annotate 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 |
rev | line source |
---|---|
196
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
1 #ifndef TEST_UTILS_HPP |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
2 #define TEST_UTILS_HPP |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
3 |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
4 #include "Motion.hpp" |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
5 |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
6 #include "opencv2/core/core.hpp" |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
7 |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
8 #include <boost/shared_ptr.hpp> |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
9 |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
10 inline boost::shared_ptr<FeatureTrajectory> createFeatureTrajectory(const int& firstInstant, const int& lastInstant, const cv::Point2f& firstPosition, const cv::Point2f& velocity) { |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
11 cv::Mat emptyHomography; |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
12 boost::shared_ptr<FeatureTrajectory> t = boost::shared_ptr<FeatureTrajectory>(new FeatureTrajectory(firstInstant, firstPosition, emptyHomography)); |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
13 cv::Point2f p = firstPosition; |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
14 for (int i=firstInstant+1; i<=lastInstant; ++i) { |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
15 p = p+velocity; |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
16 t->addPoint(i, p, emptyHomography); |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
17 } |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
18 return t; |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
19 } |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
20 |
aeab0b88c9b6
began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
21 #endif |