Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

Vision Class Reference

#include <Vision.h>

List of all members.

Public Member Functions

 Vision ()
 ~Vision ()
int setThreshold (int threshold_id)
const vector3dget_camera_loc ()
const vector3dget_camera_dir ()
int getColor (int x, int y)
int getWidth ()
int getHeight ()
void initialize ()
void setCameraParam ()
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)
bool saveThresholdImage (char *filename)
void sendRawImage ()
void sendRLEImage ()
void sendColorArea ()

Public Attributes

unsigned long frameTimestamp
int frame_count
int num_tmaps
int cur_tmap
cmap_tcmap
cmap_ttmap [MAX_TMAPS]
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]
vector3d camera_loc
vector3d camera_dir
vector3d camera_up
vector3d camera_right
double sq_distort_coeff
double lin_distort_coeff
bool calcTotalArea
Marker markers [3]
int vis_markers
ObjectInfo * obj_info

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

int outCountAvgColor
int outCountColorArea
int outCountRaw
int outCountRLE
VisionSerializervser
CMVision::image_yuv< const
uchar > 
img

Friends

class VisionSerializer


Constructor & Destructor Documentation

Vision::Vision  ) 
 

Definition at line 23 of file Vision.cc.

References initialize(), setCameraParam(), VisionSerializer, and vser.

Vision::~Vision  )  [inline]
 

Definition at line 101 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 314 of file Vision.cc.

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

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

Definition at line 329 of file Vision.cc.

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

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

Definition at line 199 of file Vision.h.

References calcEdgeMask().

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

Definition at line 299 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 267 of file Vision.cc.

References cmap, max_height, max_width, num_tmaps, reg, rmap, and tmap.

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

Definition at line 821 of file Vision.cc.

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

void Vision::disableEvents int  vevent  ) 
 

Definition at line 221 of file Vision.cc.

References VisionEventSpec::listeners, and vevent_spec.

void Vision::enableEvents int  vevent,
int  noise
 

Definition at line 216 of file Vision.cc.

References enableEvents(), and setNoiseThreshold().

void Vision::enableEvents int  vevent  ) 
 

Definition at line 212 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 380 of file Vision.cc.

References addToHistHorizStrip(), addToHistVertStrip(), bound(), calcEdgeMask(), color, COLOR_BLUE, color_class_state, COLOR_GREEN, COLOR_PINK, COLOR_RED, gaussian_with_min(), generateEvent(), height, MAX_COLORS, pct_from_mean(), VisionEventNS::PinkBallSID, VisionEventNS::RedBallSID, VisionObjectInfo::reg, region, vevent_spec, and width.

bool Vision::findGesture VisionObjectInfo hand_info  )  [private]
 

Definition at line 779 of file Vision.cc.

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

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

Definition at line 344 of file Vision.cc.

References color, color_class_state, COLOR_SKIN, generateEvent(), VisionEventNS::HandSID, VisionObjectInfo::reg, region, and vevent_spec.

bool Vision::findMarkers  )  [private]
 

Definition at line 660 of file Vision.cc.

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

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 600 of file Vision.cc.

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

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

Definition at line 230 of file Vision.cc.

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

const vector3d& Vision::get_camera_dir  )  [inline]
 

Definition at line 134 of file Vision.h.

References camera_dir.

const vector3d& Vision::get_camera_loc  )  [inline]
 

Definition at line 133 of file Vision.h.

References camera_loc.

int Vision::getColor int  x,
int  y
[inline]
 

Definition at line 135 of file Vision.h.

References cmap, COLOR_BACKGROUND, height, and width.

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

Definition at line 183 of file Vision.h.

References cmap, and width.

int Vision::getHeight  )  [inline]
 

Definition at line 139 of file Vision.h.

References height.

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

Definition at line 185 of file Vision.h.

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

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

int Vision::getWidth  )  [inline]
 

Definition at line 138 of file Vision.h.

References width.

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

Definition at line 627 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 63 of file Vision.cc.

References bits_u, bits_v, bits_y, body_angle, body_height, cmap, cmap_t, color, Config::vision_config::colors, config, cur_tmap, frame_count, frameTimestamp, head_angles, height, initializeEventSpecs(), MAX_COLORS, max_height, max_regions, max_runs, max_width, MIN_EXP_REGION_SIZE, MIN_EXP_RUN_LENGTH, NewLarge(), num_colors, num_tmaps, obj_info, reg, Config::vision_config::resolution, rmap, rmap2, Config::vision_config::thresh, tmap, Config::vision, and width.

void Vision::initializeEventSpecs  ) 
 

Definition at line 195 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 618 of file Vision.cc.

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

Definition at line 606 of file Vision.cc.

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
 

Definition at line 982 of file Vision.cc.

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

bool Vision::runHighLevelVision ObjectInfo *  obj_info  )  [private]
 

Definition at line 828 of file Vision.cc.

References COLOR_PINK, COLOR_RED, findBall(), findGesture(), findHand(), findMarkers(), VisionInterface::HAND, isIn(), VisionInterface::NUM_VISION_OBJECTS, VisionInterface::PBALL, VisionInterface::RBALL, reg, VisionObjectInfo::reg, and vobj_info.

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

Definition at line 877 of file Vision.cc.

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

bool Vision::saveThresholdImage char *  filename  ) 
 

Definition at line 1030 of file Vision.cc.

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

void Vision::sendColorArea  ) 
 

void Vision::sendRawImage  ) 
 

void Vision::sendRLEImage  ) 
 

void Vision::setCameraParam  ) 
 

Definition at line 30 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::setNoiseThreshold int  vevent,
int  noise
 

Definition at line 226 of file Vision.cc.

References VisionEventSpec::filter, and vevent_spec.

int Vision::setThreshold int  threshold_id  ) 
 

Definition at line 1019 of file Vision.cc.

References cur_tmap, and num_tmaps.

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

Definition at line 860 of file Vision.cc.

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

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

Definition at line 845 of file Vision.cc.

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


Friends And Related Function Documentation

friend class VisionSerializer [friend]
 

Definition at line 98 of file Vision.h.


Member Data Documentation

double Vision::body_angle
 

Definition at line 123 of file Vision.h.

double Vision::body_height
 

Definition at line 123 of file Vision.h.

bool Vision::calcTotalArea
 

Definition at line 159 of file Vision.h.

vector3d Vision::camera_dir
 

Definition at line 126 of file Vision.h.

vector3d Vision::camera_loc
 

Definition at line 126 of file Vision.h.

vector3d Vision::camera_right
 

Definition at line 126 of file Vision.h.

vector3d Vision::camera_up
 

Definition at line 126 of file Vision.h.

cmap_t* Vision::cmap
 

Definition at line 108 of file Vision.h.

color_class_state Vision::color[MAX_COLORS]
 

Definition at line 116 of file Vision.h.

int Vision::cur_tmap
 

Definition at line 107 of file Vision.h.

int Vision::frame_count
 

Definition at line 104 of file Vision.h.

unsigned long Vision::frameTimestamp
 

Definition at line 103 of file Vision.h.

double Vision::head_angles[3]
 

Definition at line 124 of file Vision.h.

int Vision::height
 

Definition at line 118 of file Vision.h.

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

Definition at line 175 of file Vision.h.

double Vision::lin_distort_coeff
 

Definition at line 129 of file Vision.h.

Marker Vision::markers[3]
 

Definition at line 161 of file Vision.h.

int Vision::max_height
 

Definition at line 119 of file Vision.h.

int Vision::max_regions
 

Definition at line 120 of file Vision.h.

int Vision::max_runs
 

Definition at line 120 of file Vision.h.

int Vision::max_width
 

Definition at line 119 of file Vision.h.

int Vision::num_colors
 

Definition at line 121 of file Vision.h.

int Vision::num_regions
 

Definition at line 121 of file Vision.h.

int Vision::num_runs
 

Definition at line 121 of file Vision.h.

int Vision::num_tmaps
 

Definition at line 106 of file Vision.h.

ObjectInfo* Vision::obj_info
 

Definition at line 163 of file Vision.h.

int Vision::outCountAvgColor [private]
 

Definition at line 167 of file Vision.h.

int Vision::outCountColorArea [private]
 

Definition at line 168 of file Vision.h.

int Vision::outCountRaw [private]
 

Definition at line 169 of file Vision.h.

int Vision::outCountRLE [private]
 

Definition at line 170 of file Vision.h.

region* Vision::reg
 

Definition at line 110 of file Vision.h.

run* Vision::rmap
 

Definition at line 109 of file Vision.h.

run * Vision::rmap2
 

Definition at line 109 of file Vision.h.

double Vision::sq_distort_coeff
 

Definition at line 129 of file Vision.h.

cmap_t * Vision::tmap[MAX_TMAPS]
 

Definition at line 108 of file Vision.h.

VisionEventSpec Vision::vevent_spec[NUM_VEVENTS]
 

Definition at line 114 of file Vision.h.

int Vision::vis_markers
 

Definition at line 162 of file Vision.h.

VisionObjectInfo Vision::vobj_info[NUM_VISION_OBJECTS]
 

Definition at line 113 of file Vision.h.

VisionSerializer* Vision::vser [private]
 

Definition at line 172 of file Vision.h.

int Vision::width
 

Definition at line 118 of file Vision.h.

int Vision::yindex[144]
 

Definition at line 111 of file Vision.h.


The documentation for this class was generated from the following files:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:14 2003 by Doxygen 1.3.2