The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MPKeyFrameCollection Struct Reference

#include <MPKeyFrame.h>

List of all members.

Public Member Functions

void add_to_collection (MPKeyFrame &frame)
bool empty ()
void get_keyframe (long &framenum, int &x, int &y, int &w, int &h, int &n)
void get_keyframe (MPKeyFrame &frame, int &n)
void read_frames_from_file (char *filename)
int size ()
void write_frames_to_file (char *filename)


Member Function Documentation

void add_to_collection MPKeyFrame frame  ) 
 

Definition at line 39 of file MPKeyFrame.cpp.

References m_Collection.

Referenced by read_frames_from_file().

00039                                                               {
00040         m_Collection.push_back(frame);
00041 }

bool empty  ) 
 

Definition at line 73 of file MPKeyFrame.cpp.

References m_Collection.

Referenced by MPColorTracker::DoSearch().

00073                                  {
00074         return(m_Collection.empty());
00075 }

void get_keyframe long &  framenum,
int &  x,
int &  y,
int &  w,
int &  h,
int &  n
 

Definition at line 62 of file MPKeyFrame.cpp.

References f(), MPKeyFrame::framenum, MPKeyFrame::h, m_Collection, MPKeyFrame::w, MPKeyFrame::x, MPKeyFrame::y, and y.

00062                                                                                               {
00063         MPKeyFrame &f = m_Collection[n];
00064         framenum =f.framenum;
00065         x = f.x;
00066         y = f.y;
00067         w = f.w;
00068         h = f.h;
00069 }

Here is the call graph for this function:

void get_keyframe MPKeyFrame frame,
int &  n
 

Definition at line 51 of file MPKeyFrame.cpp.

References f(), MPKeyFrame::framenum, MPKeyFrame::h, m_Collection, MPKeyFrame::w, MPKeyFrame::x, and MPKeyFrame::y.

Referenced by MPColorTracker::DoSearch(), and cvHistWrapper::process().

00051                                                                  {
00052         MPKeyFrame &f = m_Collection[n];
00053         frame.framenum = f.framenum;
00054         frame.x = f.x;
00055         frame.y = f.y;
00056         frame.w = f.w;
00057         frame.h = f.h;
00058 }

Here is the call graph for this function:

void read_frames_from_file char *  filename  ) 
 

Definition at line 85 of file MPKeyFrame.cpp.

References add_to_collection(), and y.

00085                                                                {
00086         ifstream is(filename);
00087         while (!is.eof()) {
00088                 int framenum = 0, x = 0, y = 0, w = 0, h = 0;
00089                 is >> framenum >> x >> y >> w >> h;
00090                 if (framenum + x + y + w + h == 0) break;
00091                 MPKeyFrame *kf = new MPKeyFrame(framenum, x, y, w, h);
00092                 MPKeyFrame &kfr = *kf;
00093                 add_to_collection(kfr);
00094                 //my_memory = true;
00095         }
00096         is.close();
00097 }

Here is the call graph for this function:

int size  ) 
 

Definition at line 79 of file MPKeyFrame.cpp.

References m_Collection.

Referenced by MPColorTracker::DoSearch(), and cvHistWrapper::process().

00079                                {
00080         return(m_Collection.size());
00081 }

void write_frames_to_file char *  filename  ) 
 

Definition at line 101 of file MPKeyFrame.cpp.

References MPKeyFrame::framenum, MPKeyFrame::h, m_Collection, MPKeyFrame::w, MPKeyFrame::x, and MPKeyFrame::y.

00101                                                               {
00102         ofstream os(filename);
00103         for (vector<MPKeyFrame>::iterator it = m_Collection.begin(); it != m_Collection.end(); it++) {
00104                 MPKeyFrame &kf = *it;
00105                 os << kf.framenum << "\t";
00106                 os << kf.x << "\t";
00107                 os << kf.y << "\t";
00108                 os << kf.w << "\t";
00109                 os << kf.h << endl;
00110         }
00111         os.close();
00112 }


The documentation for this struct was generated from the following files:
Generated on Mon Nov 8 17:08:40 2004 for MPT by  doxygen 1.3.9.1