Vision Class Reference

The Vision class is the driver of the VisionBehavior classes. More...

#include <vision.hpp>

List of all members.

Public Member Functions

 Vision (int delay=0, bool night=false)
 Vision (VisionBehaviors &behaviors, int delay=0, bool night=false)
 ~Vision ()
template<class T>
void addBehavior (T *v)
 Add a VisionBehavior on the fly.
IplImage & workOn (const IplImage &)
 Use the Vision driver on a single Image.
void workAndDisplay (CvCapture &)
 Use an OpenCv CvCapture to get frames, do the computations on them, and then show the results on a window.
void setDelay (int)
void setNight (bool)

Private Member Functions

IplImage & workOn2 (IplImage &)
void actOnKeyPressed ()
void die (std::string)
void freeResult ()

Private Attributes

IplImage * result
int delay
int wait
char keyPressed
VisionBehaviors behaviors
bool night

Static Private Attributes

static std::string window_name = "window_name"


Detailed Description

The Vision class is the driver of the VisionBehavior classes.

It can work with a single image or with a OpenCv capture device (CvCapture): It means it works with a camera. It can show the result of the VisionBehavior instances on a window (it is still using OpenCv).


Constructor & Destructor Documentation

Vision::Vision ( int  delay = 0,
bool  night = false 
)

By example: delay = 2. You call workOn(img1) once. Then you called it again workOn(img2) and you get img1 (no computations have been done) and then you called it with workOn(img3) and here you get img3...

Vision::Vision ( VisionBehaviors behaviors,
int  delay = 0,
bool  night = false 
)

By example: delay = 2. You call workOn(img1) once. Then you called it again workOn(img2) and you get img1 (no computations have been done) and then you called it with workOn(img3) and here you get img3...

Vision::~Vision (  ) 


Member Function Documentation

template<class T>
void Vision::addBehavior ( T *  v  )  [inline]

Add a VisionBehavior on the fly.

I would prefer use addBehavior(VisionBehavior<T>*) but it causes problem when I called it. Nevertheless, it won't ever compile if it is not this kind of type.

IplImage & Vision::workOn ( const IplImage &  src  ) 

Use the Vision driver on a single Image.

Returns:
an image, don't free it!

void Vision::workAndDisplay ( CvCapture &  camera  ) 

Use an OpenCv CvCapture to get frames, do the computations on them, and then show the results on a window.

void Vision::setDelay ( int  delay  ) 

By example: delay = 2. You call workOn(img1) once. Then you called it again workOn(img2) and you get img1 (no computations have been done) and then you called it with workOn(img3) and here you get img3...

void Vision::setNight ( bool  b  ) 

IplImage & Vision::workOn2 ( IplImage &  result  )  [private]

void Vision::actOnKeyPressed (  )  [private]

void Vision::die ( std::string  str  )  [private]

void Vision::freeResult (  )  [private]


Member Data Documentation

IplImage* Vision::result [private]

int Vision::delay [private]

int Vision::wait [private]

char Vision::keyPressed [private]

VisionBehaviors Vision::behaviors [private]

bool Vision::night [private]

std::string Vision::window_name = "window_name" [static, private]


The documentation for this class was generated from the following files:
Generated on Mon Dec 31 13:33:37 2007 for Vision by  doxygen 1.5.3