KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pt_face_2d_trajectory.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Jinyan Guan
17  * =========================================================================== */
18 
19 /* $Id: pt_face_2d_trajectory.h 18329 2014-12-02 04:29:44Z ksimek $ */
20 
21 #ifndef PT_FACE_2D_TRAJECTORY_H
22 #define PT_FACE_2D_TRAJECTORY_H
23 
27 
30 namespace kjb {
31 namespace pt {
32 
33 /* \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ */
34 
38 
39 
42 (
43  const Trajectory& traj,
44  const Perspective_camera& cam
45 );
46 
49 (
50  const Trajectory_map& trajs,
51  const Perspective_camera& cam
52 );
53 
54 }}
55 
56 namespace kjb {
57 namespace tracking {
58 
60 template <>
61 inline
62 bool kjb::pt::Face_2d_trajectory_element::parse(const std::string& /*line*/)
63 {
64 // using namespace std;
65 // istringstream istr(line);
66 // vector<double> elems;
67 //
68 // copy(istream_iterator<double>(istr), istream_iterator<double>(),
69 // back_inserter(elems));
70 //
71 // IFT(elems.size() == 3, Runtime_error,
72 // "Cannot read trajectory element: line has wrong format.");
73 //
74 // if(elems.back() == 0.0)
75 // return false;
76 //
77 // value = Face_2d(elems[0], elems[1]);
78 
79  return true;
80 }
81 
83 template <>
84 inline
85 void kjb::pt::Face_2d_trajectory_element::write(std::ofstream& /*ofs*/) const
86 {
87  //ofs << value << " 1.0" << std::endl;
88 }
89 
91 template <>
92 inline
94 {
95  ofs << "0.0 0.0 0.0" << std::endl;
96 }
97 
98 }}
99 
100 #endif /*PT_FACE_2D_TRACJECTORY_H */
101 
Generic_trajectory_map< Face_2d > Face_2d_trajectory_map
Definition: pt_face_2d_trajectory.h:35
Face_2d_trajectory get_face_2d_trajectory(const Trajectory &traj, const Perspective_camera &cam)
Convert a Trajectory to a Face_2d_trajectory.
Definition: pt_face_2d_trajectory.cpp:31
Represents an element of a trajectory of a particular entity.
Definition: tracking_trajectory.h:61
void write(std::ofstream &ofs) const
Writes this element to a stream.
Definition: tracking_trajectory.h:79
Definition: perspective_camera.h:93
Represents a set of trajectories; it is a map from entity to trajectory.
Definition: tracking_trajectory.h:53
Generic_trajectory_element< Face_2d > Face_2d_trajectory_element
Definition: pt_face_2d_trajectory.h:37
Face_2d_trajectory_map get_face_2d_trajectory_map(const Trajectory_map &trajs, const Perspective_camera &cam)
Convert a Trajectory_map to a Face_2d_trajectory_map.
Definition: pt_face_2d_trajectory.cpp:62
bool parse(const std::string &line)
Reads an element from a line of a file.
Definition: tracking_trajectory.h:70
static void write_invalid(std::ofstream &ofs)
Writes this element to a stream.
Definition: tracking_trajectory.h:88
Generic_trajectory< Face_2d > Face_2d_trajectory
Definition: pt_face_2d_trajectory.h:36