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

# GoalRecognizer Class Reference

The goal recognizer recognizes the goals in the image. More...

`#include <GoalRecognizer.h>`

Collaboration diagram for GoalRecognizer:

[legend]
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
enum | { maxNumberOfHorizontalScanLines = 32 }
enum | { maxNumberOfGoalScanLines = 255 }
## Private Member Functions
void | calculateScanLinesParallelToHorizon ()
| Calculates the scan lines near the horizon for the goals.
void | calculateScanLinesParallelToHorizon (int distanceAboveHorizon, int distanceBelowHorizon, int numberOfScanLines)
| Calculates the scan lines near the horizon for the goals.
void | scanHorizontalForGoals ()
| Scans horizontal for goals.
void | calculateVerticalGoalScanLines ()
| Calculates the vertical scan lines for the goals.
void | scanLinesForGoals ()
| Scans vertical for goals.
| DECLARE_DEBUG_IMAGE (imageProcessorGoals)
## Private Attributes
const Image & | image
| A reference to the image that is scanned for a goal.
const CameraMatrix & | cameraMatrix
| A reference to the camera matrix that describes position and rotation of the camera when the image was aquired.
const ColorTable & | colorTable
| A reference to the color table.
int | goalIndicationAboveHorizon
int | goalIndicationBelowHorizon
bool | useFixedScanLines
ObstaclesPercept & | obstaclesPercept
| A reference to the obstacles percept.
LandmarksPercept & | landmarksPercept
| A reference to the obstacles percept.
colorClass | colorOfOpponentGoal
| The color class of the opponent goal.
colorClass | colorOfOwnGoal
| The color class of the own goal.
Geometry::Line | horizonLine
| A representation of the horizon.
Geometry::Line | verticalLine
| A representation of the horizon.
int | numberOfHorizontalScanLines
| The number of horizontal scan lines.
Vector2< int > | leftPoint [maxNumberOfHorizontalScanLines]
| representation of the left points of the horizontal scan lines
Vector2< int > | rightPoint [maxNumberOfHorizontalScanLines]
| representation of the right points of the horizontal scan lines
int | numberOfGoalIndications
| the number of indications for goals
Vector2< int > | goalIndicationLeft [maxNumberOfGoalScanLines]
| left point of an indications for a goal
Vector2< int > | goalIndicationCenter [maxNumberOfGoalScanLines]
| left point of an indications for a goal
Vector2< int > | goalIndicationRight [maxNumberOfGoalScanLines]
| right point of an indication for a goal
bool | leftOfGoalIndicationIsOnBorder [maxNumberOfGoalScanLines]
| true if the left end of the goal indication is on the border of the image
bool | rightOfGoalIndicationIsOnBorder [maxNumberOfGoalScanLines]
| true if the right end of the goal indication is on the border of the image
colorClass | colorOfGoalIndication [maxNumberOfGoalScanLines]
| the color class of the goal indication
int | numberOfGoalScanLines
| The number of vertical scan lines where a goal is searched.
Vector2< int > | topGoalPoint [maxNumberOfGoalScanLines]
| representation of the top points of the goal scan lines
Vector2< int > | bottomGoalPoint [maxNumberOfGoalScanLines]
| representation of the bottom points of the goal scan lines
bool | scanLineToCheckBestAngle [maxNumberOfGoalScanLines]
int | indexOfGoalIndication [maxNumberOfGoalScanLines]
colorClass | colorOfGoalScanLine [maxNumberOfGoalScanLines]

## 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]`

  | Enumeration values:
  maxNumberOfHorizontalScanLines |
Definition at line 169 of file GoalRecognizer.h.

anonymous enum`[private]`

  | Enumeration values:
  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. References ~GoalRecognizer(). Referenced by ~GoalRecognizer().

Here is the call graph for this function:

## Member Function Documentation

void GoalRecognizer::getGoalPercept | ( | LandmarksPercept & | landmarksPercept | ) |

| Definition at line 66 of file GoalRecognizer.cpp. References Geometry::Line::base, Geometry::calculateHorizon(), calculateVerticalGoalScanLines(), colorOfOpponentGoal, colorOfOwnGoal, Geometry::Line::direction, getGoalPercept(), getPlayer(), Player::getTeamColor(), INIT_DEBUG_IMAGE, scanHorizontalForGoals(), scanLinesForGoals(), SEND_DEBUG_IMAGE, useFixedScanLines, Vector2< double >::x, and Vector2< double >::y. Referenced by getGoalPercept().

Here is the call graph for this function:

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, Geometry::Line::direction, and Geometry::getIntersectionPointsOfLineAndRectangle().

Here is the call graph for this function:

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, and Geometry::getIntersectionPointsOfLineAndRectangle().

Here is the call graph for this function:

void GoalRecognizer::scanHorizontalForGoals | ( |  | ) | `[private]`

| Scans horizontal for goals. Definition at line 160 of file GoalRecognizer.cpp. References RangeArray< T >::add(), Geometry::calculatePointByAngles(), 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 >::getNumberOfClusters(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Range< T >::getSize(), goalIndicationCenter, goalIndicationLeft, goalIndicationRight, GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, LINE, Range< T >::max, Range< T >::min, GoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, numberOfGoalIndications, GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, GoalRecognizer::ColoredPartsCheck::rangeOfColor, rightOfGoalIndicationIsOnBorder, scanHorizontalForGoals(), Vector2< V >::x, Vector2< int >::x, Vector2< V >::y, and Vector2< int >::y. Referenced by getGoalPercept(), and scanHorizontalForGoals().

Here is the call graph for this function:

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(), calculateVerticalGoalScanLines(), Geometry::clipLineWithRectangleCohenSutherland(), colorOfGoalIndication, colorOfGoalScanLine, colorOfOpponentGoal, colorOfOwnGoal, goalIndicationCenter, goalIndicationLeft, goalIndicationRight, indexOfGoalIndication, numberOfGoalIndications, numberOfGoalScanLines, scanLineToCheckBestAngle, topGoalPoint, Vector2< V >::x, and Vector2< V >::y. Referenced by calculateVerticalGoalScanLines(), and getGoalPercept().

Here is the call graph for this function:

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(), bottomGoalPoint, Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), COLOR_CLASS, colorOfGoalIndication, colorOfGoalScanLine, colorOfOpponentGoal, 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(), DOT, GoalRecognizer::ColoredPartsCheck::firstPoint, fromDegrees(), Geometry::getDistanceBySize(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), getPlayer(), Range< double >::getSize(), Player::getTeamColor(), goalIndicationLeft, goalIndicationRight, indexOfGoalIndication, ConditionalBoundary::isOnBorder(), GoalRecognizer::ColoredPartsCheck::largePartBegin, GoalRecognizer::ColoredPartsCheck::largePartBeginIsOnBorder, GoalRecognizer::ColoredPartsCheck::largePartEnd, GoalRecognizer::ColoredPartsCheck::largePartEndIsOnBorder, GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, LINE, Range< double >::max, maxNumberOfGoalScanLines, Range< double >::min, GoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, numberOfGoalIndications, numberOfGoalScanLines, GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, GoalRecognizer::ColoredPartsCheck::rangeOfColor, rightOfGoalIndicationIsOnBorder, scanLinesForGoals(), scanLineToCheckBestAngle, topGoalPoint, Boundary< double >::x, Vector2< V >::x, Vector2< int >::x, Boundary< double >::y, Vector2< V >::y, and Vector2< int >::y. Referenced by getGoalPercept(), and scanLinesForGoals().

Here is the call graph for this function:

GoalRecognizer::DECLARE_DEBUG_IMAGE | ( | imageProcessorGoals |  | ) | `[private]`

## Member Data Documentation

const Image& GoalRecognizer::image`[private]`

| A reference to the image that is scanned for a goal. Definition at line 139 of file GoalRecognizer.h.

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.

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.

bool GoalRecognizer::useFixedScanLines`[private]`

| Definition at line 149 of file GoalRecognizer.h. Referenced by getGoalPercept().

ObstaclesPercept& GoalRecognizer::obstaclesPercept`[private]`

| A reference to the obstacles percept. Definition at line 152 of file GoalRecognizer.h.

LandmarksPercept& GoalRecognizer::landmarksPercept`[private]`

| A reference to the obstacles percept. Definition at line 155 of file GoalRecognizer.h.

colorClass GoalRecognizer::colorOfOpponentGoal`[private]`

| The color class of the opponent goal. Definition at line 158 of file GoalRecognizer.h. Referenced by calculateVerticalGoalScanLines(), 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 calculateVerticalGoalScanLines(), and getGoalPercept().

Geometry::Line GoalRecognizer::horizonLine`[private]`

| A representation of the horizon. Definition at line 164 of file GoalRecognizer.h.

Geometry::Line GoalRecognizer::verticalLine`[private]`

| A representation of the horizon. Definition at line 164 of file GoalRecognizer.h.

int GoalRecognizer::numberOfHorizontalScanLines`[private]`

| The number of horizontal scan lines. Definition at line 167 of file GoalRecognizer.h.

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

| representation of the left points of the horizontal scan lines Definition at line 173 of file GoalRecognizer.h.

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

| representation of the right points of the horizontal scan lines Definition at line 176 of file GoalRecognizer.h.

int GoalRecognizer::numberOfGoalIndications`[private]`

| the number of indications for goals Definition at line 179 of file GoalRecognizer.h. Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().

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::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::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().

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().

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().

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().

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().

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().

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().

bool GoalRecognizer::scanLineToCheckBestAngle[maxNumberOfGoalScanLines]`[private]`

| Definition at line 208 of file GoalRecognizer.h. Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

int GoalRecognizer::indexOfGoalIndication[maxNumberOfGoalScanLines]`[private]`

| Definition at line 211 of file GoalRecognizer.h. Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

colorClass GoalRecognizer::colorOfGoalScanLine[maxNumberOfGoalScanLines]`[private]`

| Definition at line 214 of file GoalRecognizer.h. Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().

The documentation for this class was generated from the following files:

- Modules/ImageProcessor/ImageProcessorTools/GoalRecognizer.h
- Modules/ImageProcessor/ImageProcessorTools/GoalRecognizer.cpp