Homepage Demos Overview Downloads Tutorials Reference
Credits

Vision Class Reference

#include <Vision.h>

List of all members.

Public Member Functions

 Vision ()
 ~Vision ()
int getWidth ()
int getHeight ()
void initialize ()
void setCameraParams ()
void setResolution ()
void setColors ()
int getColor (const char *color)
void initializeEventSpecs ()
void enableEvents (int vevent)
void enableEvents (int vevent, int noise)
void disableEvents (int vevent)
void setNoiseThreshold (int vevent, int noise)
bool close ()
bool processFrame (const uchar *data_y, const uchar *data_u, const uchar *data_v, int width, int height, int skip)
bool saveThresholdImage (char *filename)

Public Attributes

unsigned long frameTimestamp
int frame_count
cmap_tcmap
cmap_ttmap
runrmap
runrmap2
regionreg
int yindex [144]
VisionObjectInfo vobj_info [NUM_VISION_OBJECTS]
VisionEventSpec vevent_spec [NUM_VEVENTS]
color_class_state color [MAX_COLORS]
int width
int height
int max_width
int max_height
int max_runs
int max_regions
int num_colors
int num_runs
int num_regions
double body_angle
double body_height
double head_angles [3]
Marker markers [3]
int vis_markers
ObjectInfoobj_info
OFbkImageLayer imageLayer

Private Member Functions

bool thresholdImage (CMVision::image_idx< rgb > &img)
bool thresholdImage (CMVision::image_yuv< const uchar > &img)
template<class image> bool runLowLevelVision (image &img)
int getColorUnsafe (int x, int y)
int getNearColor (int x, int y)
int addToHistHorizStrip (int y, int x1, int x2, int *color_cnt)
int addToHistVertStrip (int x, int y1, int y2, int *color_cnt)
void createEvent (unsigned int tid, unsigned int sid, float cenX, float cenY)
vector3d getPixelDirection (double x, double y)
void findSpan (double &left, double &right, double x1, double x2, double y1, double y2)
int calcEdgeMask (double x1, double x2, double y1, double y2)
int calcEdgeMask (int x1, int x2, int y1, int y2)
int calcEdgeMask (region *tmpreg)
int isIn (region *r1, region *r2)
int isAdjacent (region *r1, region *r2)
bool findHand (VObject *hand, VisionObjectInfo *hand_info)
bool findBall (int ball_color, VObject *ball, VisionObjectInfo *ball_info)
bool findThing (VObject *thing, VisionObjectInfo *thing_info)
bool findMarkers ()
bool findGesture (VisionObjectInfo *hand_info)
int identifyMarker (int color1, int color2, int color3)
bool generateEvent (int vevent, double conf, int cenX, int cenY)
bool runHighLevelVision (ObjectInfo *obj_info)
 Vision (const Vision &)
 don't copy

Vision operator= (const Vision &)
 don't assign


Private Attributes

VisionSerializervser
CMVision::image_yuv< const
uchar > 
img
hash_map< const char *, int,
hash< const char * >, hashcmp_eqstr > 
color_names

Friends

class VisionSerializer


Constructor & Destructor Documentation

Vision::Vision  ) 
 

Definition at line 23 of file Vision.cc.

References initialize(), VisionSerializer, and vser.

Here is the call graph for this function:

Vision::~Vision  )  [inline]
 

Definition at line 100 of file Vision.h.

Vision::Vision const Vision  )  [private]
 

don't copy


Member Function Documentation

int Vision::addToHistHorizStrip int  y,
int  x1,
int  x2,
int *  color_cnt
[private]
 

Definition at line 296 of file Vision.cc.

References bound(), getColorUnsafe(), height, and width.

Here is the call graph for this function:

int Vision::addToHistVertStrip int  x,
int  y1,
int  y2,
int *  color_cnt
[private]
 

Definition at line 311 of file Vision.cc.

References bound(), getColorUnsafe(), height, and width.

Here is the call graph for this function:

int Vision::calcEdgeMask region tmpreg  )  [inline, private]
 

Definition at line 178 of file Vision.h.

References calcEdgeMask().

Here is the call graph for this function:

int Vision::calcEdgeMask int  x1,
int  x2,
int  y1,
int  y2
[private]
 

Definition at line 281 of file Vision.cc.

References height, VisionInterface::OFF_EDGE_BOTTOM, VisionInterface::OFF_EDGE_LEFT, VisionInterface::OFF_EDGE_RIGHT, VisionInterface::OFF_EDGE_TOP, and width.

int Vision::calcEdgeMask double  x1,
double  x2,
double  y1,
double  y2
[private]
 

bool Vision::close  ) 
 

Definition at line 256 of file Vision.cc.

References cmap, DeleteLarge(), max_height, max_width, reg, rmap, rmap2, and tmap.

Here is the call graph for this function:

void Vision::createEvent unsigned int  tid,
unsigned int  sid,
float  cenX,
float  cenY
[private]
 

Definition at line 783 of file Vision.cc.

References erouter, EventBase::EventTypeID_t, and EventRouter::postEvent().

Here is the call graph for this function:

void Vision::disableEvents int  vevent  ) 
 

Definition at line 210 of file Vision.cc.

References VisionEventSpec::listeners, and vevent_spec.

void Vision::enableEvents int  vevent,
int  noise
 

Definition at line 205 of file Vision.cc.

References enableEvents(), and setNoiseThreshold().

Here is the call graph for this function:

void Vision::enableEvents int  vevent  ) 
 

Definition at line 201 of file Vision.cc.

References VisionEventSpec::listeners, and vevent_spec.

bool Vision::findBall int  ball_color,
VObject ball,
VisionObjectInfo ball_info
[private]
 

Definition at line 362 of file Vision.cc.

References calcEdgeMask(), color, color_class_state, VisionInterface::VObject::confidence, gaussian_with_min(), generateEvent(), getColor(), pct_from_mean(), VisionEventNS::PinkBallSID, VisionEventNS::RedBallSID, VisionObjectInfo::reg, region, and vevent_spec.

Here is the call graph for this function:

bool Vision::findGesture VisionObjectInfo hand_info  )  [private]
 

Definition at line 743 of file Vision.cc.

References generateEvent(), mathutils::limitRange(), num_runs, VisionObjectInfo::reg, rmap, VisionEventNS::ThumbsupSID, and vevent_spec.

Here is the call graph for this function:

bool Vision::findHand VObject hand,
VisionObjectInfo hand_info
[private]
 

Definition at line 326 of file Vision.cc.

References color, color_class_state, VisionInterface::VObject::confidence, generateEvent(), getColor(), VisionEventNS::HandSID, VisionObjectInfo::reg, region, and vevent_spec.

Here is the call graph for this function:

bool Vision::findMarkers  )  [private]
 

Definition at line 624 of file Vision.cc.

References color, COLOR_BGREEN, COLOR_ORANGE, COLOR_PURPLE, erouter, getColor(), identifyMarker(), isAdjacent(), markers, VisionEventNS::MarkersSID, EventRouter::postEvent(), region, VisionEvent::setProperty(), EventBase::statusETID, vevent_spec, and vis_markers.

Here is the call graph for this function:

void Vision::findSpan double &  left,
double &  right,
double  x1,
double  x2,
double  y1,
double  y2
[private]
 

bool Vision::findThing VObject thing,
VisionObjectInfo thing_info
[private]
 

Definition at line 564 of file Vision.cc.

References VisionInterface::VObject::confidence, generateEvent(), VisionObjectInfo::reg, VisionEventNS::ThingSID, and vevent_spec.

Here is the call graph for this function:

bool Vision::generateEvent int  vevent,
double  conf,
int  cenX,
int  cenY
[private]
 

Definition at line 219 of file Vision.cc.

References EventBase::activateETID, VisionEventSpec::confidence, createEvent(), EventBase::deactivateETID, EventBase::statusETID, and vevent_spec.

Here is the call graph for this function:

int Vision::getColor const char *  color  ) 
 

Definition at line 151 of file Vision.cc.

References color_names.

int Vision::getColorUnsafe int  x,
int  y
[inline, private]
 

Definition at line 162 of file Vision.h.

References cmap, and width.

int Vision::getHeight  )  [inline]
 

Definition at line 124 of file Vision.h.

References height.

int Vision::getNearColor int  x,
int  y
[inline, private]
 

Definition at line 164 of file Vision.h.

References bound(), cmap, height, and width.

Here is the call graph for this function:

vector3d Vision::getPixelDirection double  x,
double  y
[private]
 

Definition at line 969 of file Vision.cc.

References vector3d.

int Vision::getWidth  )  [inline]
 

Definition at line 123 of file Vision.h.

References width.

int Vision::identifyMarker int  color1,
int  color2,
int  color3
[private]
 

Definition at line 591 of file Vision.cc.

References COLOR_ORANGE, COLOR_PURPLE, VisionInterface::MARKER_GOG, VisionInterface::MARKER_GOP, VisionInterface::MARKER_GPG, VisionInterface::MARKER_GPO, VisionInterface::MARKER_OGO, VisionInterface::MARKER_OGP, VisionInterface::MARKER_OPG, VisionInterface::MARKER_OPO, VisionInterface::MARKER_PGO, VisionInterface::MARKER_PGP, VisionInterface::MARKER_POG, and VisionInterface::MARKER_POP.

void Vision::initialize  ) 
 

Definition at line 158 of file Vision.cc.

References bits_u, bits_v, bits_y, cmap_t, initializeEventSpecs(), obj_info, setCameraParams(), setColors(), setResolution(), and tmap.

Here is the call graph for this function:

void Vision::initializeEventSpecs  ) 
 

Definition at line 184 of file Vision.cc.

References VisionEventSpec::count, VisionEventSpec::cx, VisionEventSpec::cy, VisionEventSpec::filter, VisionEventNS::HandSID, VisionEventSpec::listeners, VisionEventNS::MarkersSID, NUM_VEVENTS, VisionEventNS::PinkBallSID, VisionEventSpec::present, VisionEventNS::RedBallSID, VisionEventNS::ThingSID, VisionEventNS::ThumbsupSID, and vevent_spec.

int Vision::isAdjacent region r1,
region r2
[private]
 

Definition at line 582 of file Vision.cc.

References region.

int Vision::isIn region r1,
region r2
[private]
 

Definition at line 570 of file Vision.cc.

References region.

Vision Vision::operator= const Vision  )  [private]
 

don't assign

bool Vision::processFrame const uchar *  data_y,
const uchar *  data_u,
const uchar *  data_v,
int  width,
int  height,
int  skip
 

Definition at line 916 of file Vision.cc.

References frame_count, frameTimestamp, get_time(), img, obj_info, runHighLevelVision(), runLowLevelVision(), VisionSerializer::serialize(), and vser.

Here is the call graph for this function:

bool Vision::runHighLevelVision ObjectInfo obj_info  )  [private]
 

Definition at line 790 of file Vision.cc.

References findBall(), getColor(), VisionInterface::NUM_VISION_OBJECTS, VisionInterface::PBALL, VisionInterface::ObjectInfo::pball, VisionObjectInfo::reg, and vobj_info.

Here is the call graph for this function:

template<class image>
bool Vision::runLowLevelVision image img  )  [private]
 

Definition at line 842 of file Vision.cc.

References cmap, color, height, image, max_regions, max_runs, num_colors, num_regions, num_runs, reg, rmap, rmap2, thresholdImage(), and width.

Here is the call graph for this function:

bool Vision::saveThresholdImage char *  filename  ) 
 

Definition at line 954 of file Vision.cc.

References cmap, color, height, num_colors, width, and WritePPM().

Here is the call graph for this function:

void Vision::setCameraParams  ) 
 

Definition at line 34 of file Vision.cc.

References config, Config::vision_config::gain, Config::vision_config::shutter_speed, Config::vision, and Config::vision_config::white_balance.

void Vision::setColors  ) 
 

Definition at line 121 of file Vision.cc.

References bits_u, bits_v, bits_y, cmap_t, color, color_names, Config::vision_config::colors, config, MAX_COLORS, num_colors, Config::vision_config::thresh, tmap, and Config::vision.

void Vision::setNoiseThreshold int  vevent,
int  noise
 

Definition at line 215 of file Vision.cc.

References VisionEventSpec::filter, and vevent_spec.

void Vision::setResolution  ) 
 

Definition at line 67 of file Vision.cc.

References cmap, config, DeleteLarge(), height, imageLayer, max_height, max_regions, max_runs, max_width, MIN_EXP_REGION_SIZE, MIN_EXP_RUN_LENGTH, NewLarge(), reg, Config::vision_config::resolution, rmap, rmap2, Config::vision, and width.

Here is the call graph for this function:

bool Vision::thresholdImage CMVision::image_yuv< const uchar > &  img  )  [private]
 

Definition at line 825 of file Vision.cc.

References bits_u, bits_v, bits_y, cmap, and tmap.

bool Vision::thresholdImage CMVision::image_idx< rgb > &  img  )  [private]
 

Definition at line 810 of file Vision.cc.

References cmap, color, height, MAX_COLORS, and width.


Friends And Related Function Documentation

friend class VisionSerializer [friend]
 

Definition at line 97 of file Vision.h.


Member Data Documentation

double Vision::body_angle
 

Definition at line 120 of file Vision.h.

double Vision::body_height
 

Definition at line 120 of file Vision.h.

cmap_t* Vision::cmap
 

Definition at line 105 of file Vision.h.

color_class_state Vision::color[MAX_COLORS]
 

Definition at line 113 of file Vision.h.

hash_map<const char*, int, hash<const char*>, hashcmp_eqstr> Vision::color_names [private]
 

Definition at line 154 of file Vision.h.

int Vision::frame_count
 

Definition at line 103 of file Vision.h.

unsigned long Vision::frameTimestamp
 

Definition at line 102 of file Vision.h.

double Vision::head_angles[3]
 

Definition at line 121 of file Vision.h.

int Vision::height
 

Definition at line 115 of file Vision.h.

OFbkImageLayer Vision::imageLayer
 

Definition at line 146 of file Vision.h.

CMVision::image_yuv<const uchar> Vision::img [private]
 

Definition at line 153 of file Vision.h.

Marker Vision::markers[3]
 

Definition at line 143 of file Vision.h.

int Vision::max_height
 

Definition at line 116 of file Vision.h.

int Vision::max_regions
 

Definition at line 117 of file Vision.h.

int Vision::max_runs
 

Definition at line 117 of file Vision.h.

int Vision::max_width
 

Definition at line 116 of file Vision.h.

int Vision::num_colors
 

Definition at line 118 of file Vision.h.

int Vision::num_regions
 

Definition at line 118 of file Vision.h.

int Vision::num_runs
 

Definition at line 118 of file Vision.h.

ObjectInfo* Vision::obj_info
 

Definition at line 145 of file Vision.h.

region* Vision::reg
 

Definition at line 107 of file Vision.h.

run* Vision::rmap
 

Definition at line 106 of file Vision.h.

run * Vision::rmap2
 

Definition at line 106 of file Vision.h.

cmap_t * Vision::tmap
 

Definition at line 105 of file Vision.h.

VisionEventSpec Vision::vevent_spec[NUM_VEVENTS]
 

Definition at line 111 of file Vision.h.

int Vision::vis_markers
 

Definition at line 144 of file Vision.h.

VisionObjectInfo Vision::vobj_info[NUM_VISION_OBJECTS]
 

Definition at line 110 of file Vision.h.

VisionSerializer* Vision::vser [private]
 

Definition at line 150 of file Vision.h.

int Vision::width
 

Definition at line 115 of file Vision.h.

int Vision::yindex[144]
 

Definition at line 108 of file Vision.h.


The documentation for this class was generated from the following files:
Tekkotsu v1.5
Generated Fri Oct 10 15:58:12 2003 by Doxygen 1.3.4