Mercurial Hosting > traffic-intelligence
comparison c/Motion.cpp @ 177:ae2286b1a3fd
added loading FeatureTrajectory from database, printing
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Sun, 30 Oct 2011 11:25:51 -0400 |
parents | 9323427aa0a3 |
children | 4f10e97cb677 |
comparison
equal
deleted
inserted
replaced
176:9323427aa0a3 | 177:ae2286b1a3fd |
---|---|
14 FeatureTrajectory::FeatureTrajectory(const int& frameNum, const cv::Point2f& p, const Mat& homography) | 14 FeatureTrajectory::FeatureTrajectory(const int& frameNum, const cv::Point2f& p, const Mat& homography) |
15 : lost(false) { | 15 : lost(false) { |
16 positions = TrajectoryPoint2fPtr(new TrajectoryPoint2f()); | 16 positions = TrajectoryPoint2fPtr(new TrajectoryPoint2f()); |
17 velocities = TrajectoryPoint2fPtr(new TrajectoryPoint2f()); | 17 velocities = TrajectoryPoint2fPtr(new TrajectoryPoint2f()); |
18 addPoint(frameNum, p, homography); | 18 addPoint(frameNum, p, homography); |
19 } | |
20 | |
21 FeatureTrajectory::FeatureTrajectory(TrajectoryPoint2fPtr& _positions, TrajectoryPoint2fPtr& _velocities) | |
22 : lost(false) { | |
23 positions = _positions; | |
24 velocities = _velocities; | |
25 } | |
26 | |
27 FeatureTrajectory::FeatureTrajectory(const int& id, TrajectoryDBAccessList<Point2f>& trajectoryDB, const string& positionsTableName, const string& velocitiesTableName) { | |
28 bool success = trajectoryDB.read(positions, id, positionsTableName); | |
29 if (!success) | |
30 cout << "problem loading positions" << endl; | |
31 success = trajectoryDB.read(velocities, id, velocitiesTableName); | |
32 if (!success) | |
33 cout << "problem loading velocities" << endl; | |
19 } | 34 } |
20 | 35 |
21 bool FeatureTrajectory::isDisplacementSmall(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const { | 36 bool FeatureTrajectory::isDisplacementSmall(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const { |
22 bool result = false; | 37 bool result = false; |
23 unsigned int nPositions = positions->size(); | 38 unsigned int nPositions = positions->size(); |