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

VLCRobotSpecialist Class Reference

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

#include <VLCRobotSpecialist.h>

Collaboration diagram for VLCRobotSpecialist:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VLCRobotSpecialist (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, VLCRectangle &body, VLCRectangle &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 VLCRobotSpecialist.h.


Constructor & Destructor Documentation

VLCRobotSpecialist::VLCRobotSpecialist 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 VLCRobotSpecialist.cpp.


Member Function Documentation

void VLCRobotSpecialist::reset  ) 
 

Resets inner states, should be called every new frame.

Definition at line 56 of file VLCRobotSpecialist.cpp.

References reset(), and RS_NUM_CANDIDATES.

Referenced by reset(), and scan().

Here is the call graph for this function:

void VLCRobotSpecialist::scan  ) 
 

Generates scanlines for further scanning.

Definition at line 63 of file VLCRobotSpecialist.cpp.

References Geometry::Line::base, Geometry::calculatePointInImage(), CameraInfo::CameraInfo(), Image::cameraInfo, CRASH_CHECK, Geometry::Line::direction, Geometry::getIntersectionOfLines(), ImageInfo::horizon, Geometry::Line::normalizeDirection(), pi_2, reset(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, RS_NUM_SCAN_LINES, scan(), 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 VLCRobotSpecialist::scan Vector2< int >  startPoint  ) 
 

Scans perpendicular to horizon.

Definition at line 228 of file VLCRobotSpecialist.cpp.

References 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, scan(), Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Here is the call graph for this function:

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

Searches for other robots in the image.

Definition at line 299 of file VLCRobotSpecialist.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 VLCRobotSpecialist::addCandidate RobotCandidate  candidate  ) 
 

Adds candidate to list.

Definition at line 396 of file VLCRobotSpecialist.cpp.

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

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

Definition at line 451 of file VLCRobotSpecialist.cpp.

References CIRCLE, CRASH_CHECK, GreenChangeEvent::distanceToHorizon, findNearestFootPoint(), List< GreenChangeEvent >::getFirst(), 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(), and findNearestFootPoint().

Here is the call graph for this function:

void VLCRobotSpecialist::clusterCandidates  )  [inline]
 

Generates PlayersPercepts from candidates.

Definition at line 132 of file VLCRobotSpecialist.h.

void VLCRobotSpecialist::clusterCandidates colorClass  color  ) 
 

Definition at line 826 of file VLCRobotSpecialist.cpp.

References CameraInfo::CameraInfo(), RobotCandidate::candidateStart, CIRCLE, RobotCandidate::color, ColorSpace::colorCount, CRASH_CHECK, findNearestFootPoint(), RobotCandidate::footPoint, List< GreenChangeEvent >::getFirst(), idText, LINE, RobotCandidate::lineID, ColorSpace::Normalize(), OUTPUT, CandidateCluster::startPosition, CandidateCluster::stopPosition, Vector2< int >::x, and Vector2< int >::y.

Here is the call graph for this function:

void VLCRobotSpecialist::generatePercept CandidateCluster  cluster  ) 
 

Generates a percept for each cluster.

Definition at line 984 of file VLCRobotSpecialist.cpp.

References Vector2< V >::abs(), RobotDirection::AddSample(), ColorSpace::AddSample(), PerceptInfo::bottomLine, Geometry::calculatePointOnField(), CameraInfo::CameraInfo(), Image::cameraInfo, RobotCandidate::candidateStart, RobotCandidate::candidateStop, CIRCLE, PerceptInfo::color, RobotCandidate::color, COLOR_CLASS, ColorSpace::colorCount, ColorCorrector::correct(), PerceptInfo::count, CRASH_CHECK, PerceptInfo::direction, DOT, ColorSpace::dY, PerceptInfo::flags, RobotCandidate::footPoint, 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, VLCRectangle::x1, VLCRectangle::x2, ColorSpace::y, Vector2< int >::y, Vector2< V >::y, VLCRectangle::y1, and VLCRectangle::y2.

Here is the call graph for this function:

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

Scans for pixels between both points.

Definition at line 1357 of file VLCRobotSpecialist.cpp.

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

Referenced by noColorPixelsBetween().

Here is the call graph for this function:

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

Definition at line 1392 of file VLCRobotSpecialist.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.

Here is the call graph for this function:

unsigned int VLCRobotSpecialist::filterPercepts ColorSpace  colorSpace,
colorClass  candidateColor
 

Definition at line 1445 of file VLCRobotSpecialist.cpp.

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

void VLCRobotSpecialist::addPercept PerceptInfo perceptInfo  ) 
 

Definition at line 1512 of file VLCRobotSpecialist.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.

Here is the call graph for this function:

void VLCRobotSpecialist::dbg_PrintGreenchanges  ) 
 

Debugfunctions.

Definition at line 1632 of file VLCRobotSpecialist.cpp.

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

Here is the call graph for this function:

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

Definition at line 1655 of file VLCRobotSpecialist.cpp.

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

Here is the call graph for this function:

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

Definition at line 1668 of file VLCRobotSpecialist.cpp.

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


Member Data Documentation

const ColorCorrector& VLCRobotSpecialist::colorCorrector [private]
 

Definition at line 180 of file VLCRobotSpecialist.h.

const Image& VLCRobotSpecialist::image [private]
 

Definition at line 182 of file VLCRobotSpecialist.h.

const ImageInfo& VLCRobotSpecialist::imageInfo [private]
 

Definition at line 183 of file VLCRobotSpecialist.h.

const ColorTable& VLCRobotSpecialist::colorTable [private]
 

Definition at line 184 of file VLCRobotSpecialist.h.

const CameraMatrix& VLCRobotSpecialist::cameraMatrix [private]
 

Definition at line 185 of file VLCRobotSpecialist.h.

const CameraMatrix& VLCRobotSpecialist::prevCameraMatrix [private]
 

Definition at line 186 of file VLCRobotSpecialist.h.

const RobotPose& VLCRobotSpecialist::robotPose [private]
 

Definition at line 187 of file VLCRobotSpecialist.h.

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

Definition at line 188 of file VLCRobotSpecialist.h.

LinesPercept& VLCRobotSpecialist::linesPercept [private]
 

Definition at line 190 of file VLCRobotSpecialist.h.

PlayersPercept& VLCRobotSpecialist::playersPercept [private]
 

Definition at line 191 of file VLCRobotSpecialist.h.

RobotCandidate VLCRobotSpecialist::candidates[RS_NUM_CANDIDATES] [private]
 

Definition at line 194 of file VLCRobotSpecialist.h.

unsigned char VLCRobotSpecialist::topIndex [private]
 

Definition at line 195 of file VLCRobotSpecialist.h.

unsigned char VLCRobotSpecialist::bottomIndex [private]
 

Definition at line 195 of file VLCRobotSpecialist.h.

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

Definition at line 197 of file VLCRobotSpecialist.h.

int VLCRobotSpecialist::noRedCount [private]
 

Definition at line 200 of file VLCRobotSpecialist.h.

int VLCRobotSpecialist::noBlueCount [private]
 

Definition at line 200 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::lastRed [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::firstRed [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::closestRed [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::lastBlue [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::firstBlue [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.

Vector2<int> VLCRobotSpecialist::closestBlue [private]
 

Definition at line 201 of file VLCRobotSpecialist.h.


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