annotate include/testutils.hpp @ 398:3399bd48cb40

Ajout d'une méthode pour obtenir le nombre de FPS Méthode de capture des trames vidéos plus résistante aux erreur Utilisation d'un dictionnaire pour les fichier de configuration afin de garder le nom des sections
author Jean-Philippe Jodoin <jpjodoin@gmail.com>
date Mon, 29 Jul 2013 13:46:07 -0400
parents f7ddfc4aeb1e
children 045d05cef9d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
201
f7ddfc4aeb1e added tests for graphs
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 196
diff changeset
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) {
196
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;
201
f7ddfc4aeb1e added tests for graphs
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 196
diff changeset
14 for (unsigned int i=firstInstant+1; i<=lastInstant; ++i) {
196
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 }
201
f7ddfc4aeb1e added tests for graphs
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents: 196
diff changeset
18 t->setId(id);
196
aeab0b88c9b6 began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff changeset
19 return t;
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
aeab0b88c9b6 began testing of FeatureGraph
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff changeset
22 #endif