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

GT2005RobotSpecialist Class Reference

The RobotSpecialist finds other robots in an image. More...

#include <GT2005RobotSpecialist.h>

Collaboration diagram for GT2005RobotSpecialist:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GT2005RobotSpecialist (const ColorCorrector &colorCorrector_, const Image &image_, const ImageInfo &imageInfo_, const ColorTable &colorTable_, const CameraMatrix &cameraMatrix_, const CameraMatrix &prevCameraMatrix_, LinesPercept &linesPercept_, PlayersPercept &playersPercept_, const RobotPose &robotPose_, const List< GreenChangeEvent > &greenChangeEvents_)
void reset ()
 Resets inner states, should be called every new frame.

void scan ()
 Generates scanlines for further scanning.

void scan (Vector2< int > startPoint)
 Scans perpendicular to horizon.

void scan (Vector2< int > startPoint, Vector2< int > endPoint)
 Searches for other robots in the image.

void addCandidate (RobotCandidate candidate)
 Adds candidate to list.

bool findNearestFootPoint (Vector2< int > &footPoint)
void clusterCandidates ()
 Generates PlayersPercepts from candidates.

void clusterCandidates (colorClass color)
void generatePercept (CandidateCluster cluster)
 Generates a percept for each cluster.

int noColorPixelsBetween (Vector2< int >, Vector2< int >, colorClass)
 Scans for pixels between both points.

ColorSpace generateColorspace (Vector2< int >, Vector2< int >)
unsigned int filterPercepts (ColorSpace colorSpace, colorClass candidateColor)
void addPercept (PerceptInfo &perceptInfo)
void dbg_PrintGreenchanges ()
 Debugfunctions.


Private Member Functions

int distanceOnField (Vector2< int >, Vector2< int >, CameraMatrix, CameraInfo)
int generateBoundings (CandidateCluster cluster, GT2005Rectangle &body, GT2005Rectangle &foot, Vector2< int > &footAVG)

Private Attributes

const ColorCorrectorcolorCorrector
const Imageimage
const ImageInfoimageInfo
const ColorTablecolorTable
const CameraMatrixcameraMatrix
const CameraMatrixprevCameraMatrix
const RobotPoserobotPose
const List< GreenChangeEvent > & greenChangeEvents
LinesPerceptlinesPercept
PlayersPerceptplayersPercept
RobotCandidate candidates [RS_NUM_CANDIDATES]
unsigned char topIndex
unsigned char bottomIndex
List< GreenChangeEvent >::Pos footIterator
int noRedCount
int noBlueCount
Vector2< int > lastRed
Vector2< int > firstRed
Vector2< int > closestRed
Vector2< int > lastBlue
Vector2< int > firstBlue
Vector2< int > closestBlue

Detailed Description

The RobotSpecialist finds other robots in an image.

Definition at line 84 of file GT2005RobotSpecialist.h.


Constructor & Destructor Documentation

GT2005RobotSpecialist::GT2005RobotSpecialist const ColorCorrector colorCorrector_,
const Image image_,
const ImageInfo imageInfo_,
const ColorTable colorTable_,
const CameraMatrix cameraMatrix_,
const CameraMatrix prevCameraMatrix_,
LinesPercept linesPercept_,
PlayersPercept playersPercept_,
const RobotPose robotPose_,
const List< GreenChangeEvent > &  greenChangeEvents_
 

Definition at line 31 of file GT2005RobotSpecialist.cpp.


Member Function Documentation

void GT2005RobotSpecialist::reset  ) 
 

Resets inner states, should be called every new frame.

Definition at line 56 of file GT2005RobotSpecialist.cpp.

References bottomIndex, RS_NUM_CANDIDATES, and topIndex.

Referenced by scan().

void GT2005RobotSpecialist::scan  ) 
 

Generates scanlines for further scanning.

Definition at line 63 of file GT2005RobotSpecialist.cpp.

References Geometry::Line::base, Geometry::calculatePointInImage(), CameraInfo::CameraInfo(), Image::cameraInfo, clusterCandidates(), CRASH_CHECK, Geometry::Line::direction, Geometry::getIntersectionOfLines(), ImageInfo::horizon, Geometry::Line::normalizeDirection(), pi_2, reset(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, RS_NUM_SCAN_LINES, Vector2< V >::x, Vector2< double >::x, Vector2< double >::y, and Vector2< V >::y.

Referenced by scan().

Here is the call graph for this function:

void GT2005RobotSpecialist::scan Vector2< int >  startPoint  ) 
 

Scans perpendicular to horizon.

Definition at line 228 of file GT2005RobotSpecialist.cpp.

References addCandidate(), Geometry::Line::base, Image::cameraInfo, RobotCandidate::candidateStart, RobotCandidate::color, COLOR_CLASS, ColorCorrector::correct(), CRASH_CHECK, Geometry::Line::direction, RobotCandidate::footPoint, Geometry::getIntersectionOfLines(), BresenhamLineScan::getNext(), ImageInfo::horizon, Image::image, LINE, noColor, BresenhamLineScan::numberOfPixels, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Here is the call graph for this function:

void GT2005RobotSpecialist::scan Vector2< int >  startPoint,
Vector2< int >  endPoint
 

Searches for other robots in the image.

Definition at line 299 of file GT2005RobotSpecialist.cpp.

References Image::cameraInfo, COLOR_CLASS, ColorCorrector::correct(), CRASH_CHECK, BresenhamLineScan::getNext(), Image::image, LINE, noColor, BresenhamLineScan::numberOfPixels, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, RS_NGP_TH_START, RS_NGP_TH_STOP, RS_NO_GREEN_PIXEL_THRESHOLD, scan(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

void GT2005RobotSpecialist::addCandidate RobotCandidate  candidate  ) 
 

Adds candidate to list.

Definition at line 396 of file GT2005RobotSpecialist.cpp.

References bottomIndex, candidates, RobotCandidate::candidateStart, RobotCandidate::candidateStop, CIRCLE, RobotCandidate::color, RobotCandidate::footPoint, LINE, RobotCandidate::lineID, RECTANGLE, RS_NUM_CANDIDATES, topIndex, Vector2< int >::x, and Vector2< int >::y.

Referenced by scan().

bool GT2005RobotSpecialist::findNearestFootPoint Vector2< int > &  footPoint  ) 
 

Definition at line 451 of file GT2005RobotSpecialist.cpp.

References CIRCLE, CRASH_CHECK, GreenChangeEvent::distanceToHorizon, footIterator, List< GreenChangeEvent >::getFirst(), greenChangeEvents, LINE, GreenChangeEvent::lineID, GreenChangeEvent::positionOnImage, RS_FOOT_GRADIENT, RS_FOOT_THRESHOLD, GreenChangeEvent::startEvent, Vector2< V >::x, Vector2< int >::x, Vector2< V >::y, and Vector2< int >::y.

Referenced by clusterCandidates().

Here is the call graph for this function:

void GT2005RobotSpecialist::clusterCandidates  )  [inline]
 

Generates PlayersPercepts from candidates.

Definition at line 132 of file GT2005RobotSpecialist.h.

Referenced by scan().

void GT2005RobotSpecialist::clusterCandidates colorClass  color  ) 
 

Definition at line 826 of file GT2005RobotSpecialist.cpp.

References bottomIndex, CameraInfo::CameraInfo(), candidates, RobotCandidate::candidateStart, CIRCLE, RobotCandidate::color, ColorSpace::colorCount, CRASH_CHECK, dbg_PrintGreenchanges(), distanceOnField(), findNearestFootPoint(), footIterator, RobotCandidate::footPoint, generateColorspace(), generatePercept(), List< GreenChangeEvent >::getFirst(), greenChangeEvents, idText, LINE, RobotCandidate::lineID, ColorSpace::Normalize(), OUTPUT, CandidateCluster::startPosition, CandidateCluster::stopPosition, topIndex, Vector2< int >::x, and Vector2< int >::y.

Here is the call graph for this function:

void GT2005RobotSpecialist::generatePercept CandidateCluster  cluster  ) 
 

Generates a percept for each cluster.

Definition at line 984 of file GT2005RobotSpecialist.cpp.

References Vector2< V >::abs(), addPercept(), RobotDirection::AddSample(), ColorSpace::AddSample(), PerceptInfo::bottomLine, Geometry::calculatePointOnField(), CameraInfo::CameraInfo(), Image::cameraInfo, candidates, RobotCandidate::candidateStart, RobotCandidate::candidateStop, CIRCLE, PerceptInfo::color, RobotCandidate::color, COLOR_CLASS, ColorSpace::colorCount, ColorCorrector::correct(), PerceptInfo::count, CRASH_CHECK, PerceptInfo::direction, DOT, ColorSpace::dY, filterPercepts(), PerceptInfo::flags, RobotCandidate::footPoint, generateBoundings(), RobotDirection::getDirection(), RobotDirection::getReliability(), idText, Image::image, RobotCandidate::lineID, PerceptInfo::lines, max, PerceptInfo::maxBounding, min, PerceptInfo::minBounding, ColorSpace::Normalize(), numOfColors, NUMSUBSPACES, OUTPUT, pi, pi_2, pi_4, PerceptInfo::position, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, CandidateCluster::startPosition, CandidateCluster::stopPosition, PerceptInfo::validity, Vector2< int >::x, Vector2< V >::x, GT2005Rectangle::x1, GT2005Rectangle::x2, ColorSpace::y, Vector2< int >::y, Vector2< V >::y, GT2005Rectangle::y1, and GT2005Rectangle::y2.

Referenced by clusterCandidates().

Here is the call graph for this function:

int GT2005RobotSpecialist::noColorPixelsBetween Vector2< int >  ,
Vector2< int >  ,
colorClass 
 

Scans for pixels between both points.

Definition at line 1357 of file GT2005RobotSpecialist.cpp.

References Image::cameraInfo, COLOR_CLASS, ColorCorrector::correct(), CRASH_CHECK, BresenhamLineScan::getNext(), Image::image, noColor, BresenhamLineScan::numberOfPixels, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

ColorSpace GT2005RobotSpecialist::generateColorspace Vector2< int >  ,
Vector2< int > 
 

Definition at line 1392 of file GT2005RobotSpecialist.cpp.

References Image::cameraInfo, COLOR_CLASS, ColorSpace::colorCount, ColorCorrector::correct(), CRASH_CHECK, ColorSpace::dY, BresenhamLineScan::getNext(), Image::image, LINE, BresenhamLineScan::numberOfPixels, numOfColors, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, ColorSpace::y, and Vector2< V >::y.

Referenced by clusterCandidates().

Here is the call graph for this function:

unsigned int GT2005RobotSpecialist::filterPercepts ColorSpace  colorSpace,
colorClass  candidateColor
 

Definition at line 1445 of file GT2005RobotSpecialist.cpp.

References ColorSpace::colorCount, ColorSpace::dY, idText, and OUTPUT.

Referenced by generatePercept().

void GT2005RobotSpecialist::addPercept PerceptInfo perceptInfo  ) 
 

Definition at line 1512 of file GT2005RobotSpecialist.cpp.

References Vector2< V >::abs(), PlayersPercept::addBluePlayer(), PlayersPercept::addRedPlayer(), ARROW, PerceptInfo::bottomLine, Geometry::calculatePointOnField(), CameraInfo::CameraInfo(), CIRCLE, PerceptInfo::color, PerceptInfo::count, PerceptInfo::direction, PerceptInfo::flags, MSHSinglePlayerPercept::flags, Pose2D::getAngle(), PerceptInfo::gradient, idText, LINE, PerceptInfo::lines, MSHSinglePlayerPercept::lines, PerceptInfo::maxBounding, PerceptInfo::minBounding, OUTPUT, PerceptInfo::position, RECTANGLE, Pose2D::translation, PerceptInfo::validity, SinglePlayerPercept::validity, Vector2< V >::x, Vector2< int >::x, Vector2< V >::y, and Vector2< int >::y.

Referenced by generatePercept().

Here is the call graph for this function:

void GT2005RobotSpecialist::dbg_PrintGreenchanges  ) 
 

Debugfunctions.

Definition at line 1632 of file GT2005RobotSpecialist.cpp.

References CIRCLE, CRASH_CHECK, List< GreenChangeEvent >::getFirst(), greenChangeEvents, GreenChangeEvent::positionOnImage, GreenChangeEvent::startEvent, Vector2< int >::x, and Vector2< int >::y.

Referenced by clusterCandidates().

Here is the call graph for this function:

int GT2005RobotSpecialist::distanceOnField Vector2< int >  ,
Vector2< int >  ,
CameraMatrix  ,
CameraInfo 
[private]
 

Definition at line 1655 of file GT2005RobotSpecialist.cpp.

References Vector2< V >::abs(), Geometry::calculatePointOnField(), Vector2< V >::x, and Vector2< V >::y.

Referenced by clusterCandidates().

Here is the call graph for this function:

int GT2005RobotSpecialist::generateBoundings CandidateCluster  cluster,
GT2005Rectangle body,
GT2005Rectangle foot,
Vector2< int > &  footAVG
[private]
 

Definition at line 1668 of file GT2005RobotSpecialist.cpp.

References candidates, RobotCandidate::candidateStart, CRASH_CHECK, RobotCandidate::footPoint, CandidateCluster::startPosition, CandidateCluster::stopPosition, Vector2< V >::x, Vector2< int >::x, GT2005Rectangle::x1, GT2005Rectangle::x2, Vector2< V >::y, Vector2< int >::y, GT2005Rectangle::y1, and GT2005Rectangle::y2.

Referenced by generatePercept().


Member Data Documentation

const ColorCorrector& GT2005RobotSpecialist::colorCorrector [private]
 

Definition at line 180 of file GT2005RobotSpecialist.h.

const Image& GT2005RobotSpecialist::image [private]
 

Definition at line 182 of file GT2005RobotSpecialist.h.

const ImageInfo& GT2005RobotSpecialist::imageInfo [private]
 

Definition at line 183 of file GT2005RobotSpecialist.h.

const ColorTable& GT2005RobotSpecialist::colorTable [private]
 

Definition at line 184 of file GT2005RobotSpecialist.h.

const CameraMatrix& GT2005RobotSpecialist::cameraMatrix [private]
 

Definition at line 185 of file GT2005RobotSpecialist.h.

const CameraMatrix& GT2005RobotSpecialist::prevCameraMatrix [private]
 

Definition at line 186 of file GT2005RobotSpecialist.h.

const RobotPose& GT2005RobotSpecialist::robotPose [private]
 

Definition at line 187 of file GT2005RobotSpecialist.h.

const List<GreenChangeEvent>& GT2005RobotSpecialist::greenChangeEvents [private]
 

Definition at line 188 of file GT2005RobotSpecialist.h.

Referenced by clusterCandidates(), dbg_PrintGreenchanges(), and findNearestFootPoint().

LinesPercept& GT2005RobotSpecialist::linesPercept [private]
 

Definition at line 190 of file GT2005RobotSpecialist.h.

PlayersPercept& GT2005RobotSpecialist::playersPercept [private]
 

Definition at line 191 of file GT2005RobotSpecialist.h.

RobotCandidate GT2005RobotSpecialist::candidates[RS_NUM_CANDIDATES] [private]
 

Definition at line 194 of file GT2005RobotSpecialist.h.

Referenced by addCandidate(), clusterCandidates(), generateBoundings(), and generatePercept().

unsigned char GT2005RobotSpecialist::topIndex [private]
 

Definition at line 195 of file GT2005RobotSpecialist.h.

Referenced by addCandidate(), clusterCandidates(), and reset().

unsigned char GT2005RobotSpecialist::bottomIndex [private]
 

Definition at line 195 of file GT2005RobotSpecialist.h.

Referenced by addCandidate(), clusterCandidates(), and reset().

List<GreenChangeEvent>::Pos GT2005RobotSpecialist::footIterator [private]
 

Definition at line 197 of file GT2005RobotSpecialist.h.

Referenced by clusterCandidates(), and findNearestFootPoint().

int GT2005RobotSpecialist::noRedCount [private]
 

Definition at line 200 of file GT2005RobotSpecialist.h.

int GT2005RobotSpecialist::noBlueCount [private]
 

Definition at line 200 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::lastRed [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::firstRed [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::closestRed [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::lastBlue [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::firstBlue [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.

Vector2<int> GT2005RobotSpecialist::closestBlue [private]
 

Definition at line 201 of file GT2005RobotSpecialist.h.


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:14:56 2006 for GT2005 by doxygen 1.3.6