GoalRecognizer Class Reference

#include <GoalRecognizer.h>

List of all members.

Public Member Functions

 GoalRecognizer (const Image &image, const CameraMatrix &cameraMatrix, const ColorTable &colorTable, ObstaclesPercept &obstaclesPercept, LandmarksPercept &landmarksPercept)
 GoalRecognizer (const Image &image, const CameraMatrix &cameraMatrix, const ColorTable &colorTable, int goalIndicationAboveHorizon, int goalIndicationBelowHorizon, ObstaclesPercept &obstaclesPercept, LandmarksPercept &landmarksPercept)
 ~GoalRecognizer ()
void getGoalPercept (LandmarksPercept &landmarksPercept)

Private Types

 maxNumberOfHorizontalScanLines = 32
 maxNumberOfGoalScanLines = 255
enum  { maxNumberOfHorizontalScanLines = 32 }
enum  { maxNumberOfGoalScanLines = 255 }

Private Member Functions

void calculateScanLinesParallelToHorizon ()
void calculateScanLinesParallelToHorizon (int distanceAboveHorizon, int distanceBelowHorizon, int numberOfScanLines)
void scanHorizontalForGoals ()
void calculateVerticalGoalScanLines ()
void scanLinesForGoals ()
 DECLARE_DEBUG_IMAGE (imageProcessorGoals)

Private Attributes

const Imageimage
const CameraMatrixcameraMatrix
const ColorTablecolorTable
int goalIndicationAboveHorizon
int goalIndicationBelowHorizon
bool useFixedScanLines
ObstaclesPerceptobstaclesPercept
LandmarksPerceptlandmarksPercept
colorClass colorOfOpponentGoal
colorClass colorOfOwnGoal
Geometry::Line horizonLine
Geometry::Line verticalLine
int numberOfHorizontalScanLines
Vector2< int > leftPoint [maxNumberOfHorizontalScanLines]
Vector2< int > rightPoint [maxNumberOfHorizontalScanLines]
int numberOfGoalIndications
Vector2< int > goalIndicationLeft [maxNumberOfGoalScanLines]
Vector2< int > goalIndicationCenter [maxNumberOfGoalScanLines]
Vector2< int > goalIndicationRight [maxNumberOfGoalScanLines]
bool leftOfGoalIndicationIsOnBorder [maxNumberOfGoalScanLines]
bool rightOfGoalIndicationIsOnBorder [maxNumberOfGoalScanLines]
colorClass colorOfGoalIndication [maxNumberOfGoalScanLines]
int numberOfGoalScanLines
Vector2< int > topGoalPoint [maxNumberOfGoalScanLines]
Vector2< int > bottomGoalPoint [maxNumberOfGoalScanLines]
bool scanLineToCheckBestAngle [maxNumberOfGoalScanLines]
int indexOfGoalIndication [maxNumberOfGoalScanLines]
colorClass colorOfGoalScanLine [maxNumberOfGoalScanLines]

Classes

struct  ColoredPartsCheck


Detailed Description

The goal recognizer recognizes the goals in the image.

The recognizer scans horizontal lines in the image left to right. Indications for a goal are grouped and checked vertical.

Author:
Matthias Juengel

Definition at line 33 of file GoalRecognizer.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
maxNumberOfHorizontalScanLines 

Definition at line 169 of file GoalRecognizer.h.

anonymous enum [private]

Enumerator:
maxNumberOfGoalScanLines 

Definition at line 170 of file GoalRecognizer.h.


Constructor & Destructor Documentation

GoalRecognizer::GoalRecognizer ( const Image image,
const CameraMatrix cameraMatrix,
const ColorTable colorTable,
ObstaclesPercept obstaclesPercept,
LandmarksPercept landmarksPercept 
)

Definition at line 44 of file GoalRecognizer.cpp.

GoalRecognizer::GoalRecognizer ( const Image image,
const CameraMatrix cameraMatrix,
const ColorTable colorTable,
int  goalIndicationAboveHorizon,
int  goalIndicationBelowHorizon,
ObstaclesPercept obstaclesPercept,
LandmarksPercept landmarksPercept 
)

Definition at line 22 of file GoalRecognizer.cpp.

GoalRecognizer::~GoalRecognizer (  ) 

Definition at line 62 of file GoalRecognizer.cpp.


Member Function Documentation

void GoalRecognizer::calculateScanLinesParallelToHorizon ( int  distanceAboveHorizon,
int  distanceBelowHorizon,
int  numberOfScanLines 
) [private]

Calculates the scan lines near the horizon for the goals

Definition at line 126 of file GoalRecognizer.cpp.

References Geometry::Line::base, Geometry::Line::direction, Geometry::getIntersectionPointsOfLineAndRectangle(), and image.

void GoalRecognizer::calculateScanLinesParallelToHorizon (  )  [private]

Calculates the scan lines near the horizon for the goals

Definition at line 98 of file GoalRecognizer.cpp.

References Geometry::Line::base, Image::cameraInfo, Geometry::Line::direction, Geometry::getIntersectionPointsOfLineAndRectangle(), horizonLine, image, leftPoint, numberOfHorizontalScanLines, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, rightPoint, and verticalLine.

Referenced by getGoalPercept().

void GoalRecognizer::calculateVerticalGoalScanLines (  )  [private]

Calculates the vertical scan lines for the goals

Definition at line 425 of file GoalRecognizer.cpp.

References bottomGoalPoint, Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), Image::cameraInfo, cameraMatrix, Geometry::clipLineWithRectangleCohenSutherland(), colorOfGoalIndication, colorOfGoalScanLine, goalIndicationCenter, goalIndicationLeft, goalIndicationRight, image, indexOfGoalIndication, numberOfGoalIndications, numberOfGoalScanLines, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, scanLineToCheckBestAngle, topGoalPoint, and Vector2< V >::y.

Referenced by getGoalPercept().

GoalRecognizer::DECLARE_DEBUG_IMAGE ( imageProcessorGoals   )  [private]

void GoalRecognizer::getGoalPercept ( LandmarksPercept landmarksPercept  ) 

Definition at line 66 of file GoalRecognizer.cpp.

References Geometry::Line::base, Player::blue, Geometry::calculateHorizon(), calculateScanLinesParallelToHorizon(), calculateVerticalGoalScanLines(), Image::cameraInfo, cameraMatrix, colorOfOpponentGoal, colorOfOwnGoal, Geometry::Line::direction, getPlayer(), horizonLine, image, INIT_DEBUG_IMAGE, scanHorizontalForGoals(), scanLinesForGoals(), SEND_DEBUG_IMAGE, skyblue, useFixedScanLines, verticalLine, Vector2< V >::x, Vector2< V >::y, and yellow.

void GoalRecognizer::scanHorizontalForGoals (  )  [private]

Scans horizontal for goals

Definition at line 160 of file GoalRecognizer.cpp.

References ObstaclesPercept::angleToFreePartOfGoal, ObstaclesPercept::angleToFreePartOfGoalWasDetermined, Drawings::blue, Geometry::calculatePointByAngles(), Image::cameraInfo, cameraMatrix, COLOR_CLASS, colorOfGoalIndication, colorOfOpponentGoal, DEBUG_IMAGE_SET_PIXEL_BLACK, DEBUG_IMAGE_SET_PIXEL_GRAY, DEBUG_IMAGE_SET_PIXEL_WHITE, GoalRecognizer::ColoredPartsCheck::determineLargePart(), DOT, GoalRecognizer::ColoredPartsCheck::firstPoint, RangeArray< T >::getCluster(), RangeArray< T >::getNumberOfClusters(), Range< T >::getSize(), goalIndicationCenter, goalIndicationLeft, goalIndicationRight, Drawings::green, Image::image, image, RangeArray< T >::isLeftOnBorder(), RangeArray< T >::isRightOnBorder(), GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, leftPoint, LINE, Range< T >::max, Range< T >::min, numberOfGoalIndications, numberOfHorizontalScanLines, GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, obstaclesPercept, CameraInfo::openingAngleWidth, ObstaclesPercept::opponentGoal, ObstaclesPercept::ownGoal, Drawings::ps_solid, GoalRecognizer::ColoredPartsCheck::rangeOfColor, rightOfGoalIndicationIsOnBorder, rightPoint, skyblue, Drawings::white, white, ObstaclesPercept::widthOfFreePartOfGoal, Vector2< V >::x, Vector2< V >::y, and yellow.

Referenced by getGoalPercept().

void GoalRecognizer::scanLinesForGoals (  )  [private]

Scans vertical for goals

scanLineToCheckBestAngle[i]

Definition at line 505 of file GoalRecognizer.cpp.

References ConditionalBoundary::add(), LandmarksPercept::addGoal(), ConditionalBoundary::addX(), ConditionalBoundary::addY(), ObstaclesPercept::angleToFreePartOfGoalWasDetermined, Player::blue, Drawings::blue, bottomGoalPoint, Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), Image::cameraInfo, cameraMatrix, COLOR_CLASS, colorOfGoalIndication, colorOfGoalScanLine, colorOfOpponentGoal, Drawings::dark_gray, DEBUG_IMAGE_SET_PIXEL_BLACK, DEBUG_IMAGE_SET_PIXEL_BLUE, DEBUG_IMAGE_SET_PIXEL_GRAY, DEBUG_IMAGE_SET_PIXEL_GREEN, DEBUG_IMAGE_SET_PIXEL_PINK, DEBUG_IMAGE_SET_PIXEL_RED, DEBUG_IMAGE_SET_PIXEL_WHITE, GoalRecognizer::ColoredPartsCheck::determineLargePart(), distance(), ObstaclesPercept::distanceToFreePartOfGoal, DOT, LandmarksPercept::estimateOffsetForGoals(), GoalRecognizer::ColoredPartsCheck::firstPoint, fromDegrees(), Geometry::getDistanceBySize(), getPlayer(), Range< T >::getSize(), Player::getTeamColor(), goalIndicationLeft, goalIndicationRight, Image::image, image, indexOfGoalIndication, ConditionalBoundary::isOnBorder(), landmarksPercept, GoalRecognizer::ColoredPartsCheck::largePartBegin, GoalRecognizer::ColoredPartsCheck::largePartBeginIsOnBorder, GoalRecognizer::ColoredPartsCheck::largePartEnd, GoalRecognizer::ColoredPartsCheck::largePartEndIsOnBorder, GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, Drawings::light_gray, LINE, Range< T >::max, maxNumberOfGoalScanLines, Range< T >::min, GoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, numberOfGoalIndications, numberOfGoalScanLines, GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, obstaclesPercept, ObstaclesPercept::opponentGoal, ObstaclesPercept::ownGoal, pink, Drawings::ps_solid, GoalRecognizer::ColoredPartsCheck::rangeOfColor, rightOfGoalIndicationIsOnBorder, scanLineToCheckBestAngle, skyblue, topGoalPoint, Pose3D::translation, white, Vector3< V >::x, Boundary< T >::x, Vector2< V >::x, Vector3< V >::y, Boundary< T >::y, Vector2< V >::y, and yellow.

Referenced by getGoalPercept().


Member Data Documentation

Vector2<int> GoalRecognizer::bottomGoalPoint[maxNumberOfGoalScanLines] [private]

representation of the bottom points of the goal scan lines

Definition at line 206 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

const CameraMatrix& GoalRecognizer::cameraMatrix [private]

A reference to the camera matrix that describes position and rotation of the camera when the image was aquired

Definition at line 142 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), GoalRecognizer::ColoredPartsCheck::determineLargePart(), getGoalPercept(), scanHorizontalForGoals(), and scanLinesForGoals().

colorClass GoalRecognizer::colorOfGoalIndication[maxNumberOfGoalScanLines] [private]

the color class of the goal indication

Definition at line 197 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().

colorClass GoalRecognizer::colorOfGoalScanLine[maxNumberOfGoalScanLines] [private]

Definition at line 214 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

colorClass GoalRecognizer::colorOfOpponentGoal [private]

The color class of the opponent goal

Definition at line 158 of file GoalRecognizer.h.

Referenced by getGoalPercept(), scanHorizontalForGoals(), and scanLinesForGoals().

colorClass GoalRecognizer::colorOfOwnGoal [private]

The color class of the own goal

Definition at line 161 of file GoalRecognizer.h.

Referenced by getGoalPercept().

const ColorTable& GoalRecognizer::colorTable [private]

A reference to the color table

Definition at line 145 of file GoalRecognizer.h.

int GoalRecognizer::goalIndicationAboveHorizon [private]

Definition at line 147 of file GoalRecognizer.h.

int GoalRecognizer::goalIndicationBelowHorizon [private]

Definition at line 148 of file GoalRecognizer.h.

Vector2<int> GoalRecognizer::goalIndicationCenter[maxNumberOfGoalScanLines] [private]

left point of an indications for a goal

Definition at line 185 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanHorizontalForGoals().

Vector2<int> GoalRecognizer::goalIndicationLeft[maxNumberOfGoalScanLines] [private]

left point of an indications for a goal

Definition at line 182 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().

Vector2<int> GoalRecognizer::goalIndicationRight[maxNumberOfGoalScanLines] [private]

right point of an indication for a goal

Definition at line 188 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().

Geometry::Line GoalRecognizer::horizonLine [private]

A representation of the horizon

Definition at line 164 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), and getGoalPercept().

const Image& GoalRecognizer::image [private]

A reference to the image that is scanned for a goal

Definition at line 139 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), calculateVerticalGoalScanLines(), getGoalPercept(), scanHorizontalForGoals(), and scanLinesForGoals().

int GoalRecognizer::indexOfGoalIndication[maxNumberOfGoalScanLines] [private]

Definition at line 211 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

LandmarksPercept& GoalRecognizer::landmarksPercept [private]

A reference to the obstacles percept

Definition at line 155 of file GoalRecognizer.h.

Referenced by scanLinesForGoals().

bool GoalRecognizer::leftOfGoalIndicationIsOnBorder[maxNumberOfGoalScanLines] [private]

true if the left end of the goal indication is on the border of the image

Definition at line 191 of file GoalRecognizer.h.

Referenced by scanHorizontalForGoals(), and scanLinesForGoals().

Vector2<int> GoalRecognizer::leftPoint[maxNumberOfHorizontalScanLines] [private]

representation of the left points of the horizontal scan lines

Definition at line 173 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().

int GoalRecognizer::numberOfGoalIndications [private]

the number of indications for goals

Definition at line 179 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().

int GoalRecognizer::numberOfGoalScanLines [private]

The number of vertical scan lines where a goal is searched

Definition at line 200 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

int GoalRecognizer::numberOfHorizontalScanLines [private]

The number of horizontal scan lines

Definition at line 167 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().

ObstaclesPercept& GoalRecognizer::obstaclesPercept [private]

A reference to the obstacles percept

Definition at line 152 of file GoalRecognizer.h.

Referenced by scanHorizontalForGoals(), and scanLinesForGoals().

bool GoalRecognizer::rightOfGoalIndicationIsOnBorder[maxNumberOfGoalScanLines] [private]

true if the right end of the goal indication is on the border of the image

Definition at line 194 of file GoalRecognizer.h.

Referenced by scanHorizontalForGoals(), and scanLinesForGoals().

Vector2<int> GoalRecognizer::rightPoint[maxNumberOfHorizontalScanLines] [private]

representation of the right points of the horizontal scan lines

Definition at line 176 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().

bool GoalRecognizer::scanLineToCheckBestAngle[maxNumberOfGoalScanLines] [private]

Definition at line 208 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

Vector2<int> GoalRecognizer::topGoalPoint[maxNumberOfGoalScanLines] [private]

representation of the top points of the goal scan lines

Definition at line 203 of file GoalRecognizer.h.

Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

bool GoalRecognizer::useFixedScanLines [private]

Definition at line 149 of file GoalRecognizer.h.

Referenced by getGoalPercept().

Geometry::Line GoalRecognizer::verticalLine [private]

Definition at line 164 of file GoalRecognizer.h.

Referenced by calculateScanLinesParallelToHorizon(), and getGoalPercept().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:32:41 2006 for DT2005.panorama by  doxygen 1.4.7