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

# SlamGoalRecognizer Class Reference

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

`#include <SlamGoalRecognizer.h>`

Collaboration diagram for SlamGoalRecognizer:

[legend]
List of all members.

## Public Member Functions
| SlamGoalRecognizer (const Image &image, const CameraMatrix &cameraMatrix, const CameraMatrix &prevCameraMatrix, const ColorTable &colorTable, const ColorCorrector &colorCorrector, ObstaclesPercept &obstaclesPercept, LandmarksPercept &landmarksPercept)
| ~SlamGoalRecognizer ()
void | execute ()
## 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 CameraMatrix & | prevCameraMatrix
| A reference to the previous 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.
const ColorCorrector & | colorCorrector
| A reference to the color corrector.
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 22 of file SlamGoalRecognizer.h.

## Member Enumeration Documentation

anonymous enum`[private]`

  | Enumeration values:
  maxNumberOfHorizontalScanLines |
Definition at line 156 of file SlamGoalRecognizer.h.

anonymous enum`[private]`

  | Enumeration values:
  maxNumberOfGoalScanLines |
Definition at line 157 of file SlamGoalRecognizer.h.

## Constructor & Destructor Documentation

SlamGoalRecognizer::SlamGoalRecognizer | ( | const Image & | image,
|  | const CameraMatrix & | cameraMatrix,
|  | const CameraMatrix & | prevCameraMatrix,
|  | const ColorTable & | colorTable,
|  | const ColorCorrector & | colorCorrector,
|  | ObstaclesPercept & | obstaclesPercept,
|  | LandmarksPercept & | landmarksPercept
| ) |

| Definition at line 25 of file SlamGoalRecognizer.cpp.

SlamGoalRecognizer::~SlamGoalRecognizer | ( |  | ) |

| Definition at line 46 of file SlamGoalRecognizer.cpp.

## Member Function Documentation

void SlamGoalRecognizer::execute | ( |  | ) |

| Definition at line 50 of file SlamGoalRecognizer.cpp. References Geometry::Line::base, Geometry::calculateHorizon(), calculateScanLinesParallelToHorizon(), calculateVerticalGoalScanLines(), Geometry::Line::direction, getPlayer(), Player::getTeamColor(), INIT_DEBUG_IMAGE, scanHorizontalForGoals(), scanLinesForGoals(), SEND_DEBUG_IMAGE, Vector2< double >::x, and Vector2< double >::y. Referenced by SlamImageProcessor::execute().

Here is the call graph for this function:

void SlamGoalRecognizer::calculateScanLinesParallelToHorizon | ( |  | ) | `[private]`

| Calculates the scan lines near the horizon for the goals. Definition at line 82 of file SlamGoalRecognizer.cpp. References Geometry::Line::base, Geometry::Line::direction, and Geometry::getIntersectionPointsOfLineAndRectangle(). Referenced by execute().

Here is the call graph for this function:

void SlamGoalRecognizer::calculateScanLinesParallelToHorizon | ( | int | distanceAboveHorizon,
|  | int | distanceBelowHorizon,
|  | int | numberOfScanLines
| ) | `[private]`

| Calculates the scan lines near the horizon for the goals. Definition at line 110 of file SlamGoalRecognizer.cpp. References Geometry::Line::base, Geometry::Line::direction, and Geometry::getIntersectionPointsOfLineAndRectangle().

Here is the call graph for this function:

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

| Scans horizontal for goals. Definition at line 144 of file SlamGoalRecognizer.cpp. References RangeArray< T >::add(), Geometry::calculatePointByAngles(), CORRECTED_COLOR_CLASS, DEBUG_IMAGE_SET_PIXEL_BLACK, DEBUG_IMAGE_SET_PIXEL_GRAY, DEBUG_IMAGE_SET_PIXEL_WHITE, SlamGoalRecognizer::ColoredPartsCheck::determineLargePart(), ObstaclesPercept::FreePartOfGoal::directionAsAngle, DOT, SlamGoalRecognizer::ColoredPartsCheck::firstPoint, RangeArray< T >::getNumberOfClusters(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Range< T >::getSize(), SlamGoalRecognizer::ColoredPartsCheck::lastPoint, LINE, Range< T >::max, Range< T >::min, SlamGoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, SlamGoalRecognizer::ColoredPartsCheck::numberOfLargeParts, SlamGoalRecognizer::ColoredPartsCheck::rangeOfColor, ObstaclesPercept::FreePartOfGoal::wasDetermined, ObstaclesPercept::FreePartOfGoal::widthAsAngle, Vector2< V >::x, Vector2< int >::x, Vector2< V >::y, and Vector2< int >::y. Referenced by execute().

Here is the call graph for this function:

void SlamGoalRecognizer::calculateVerticalGoalScanLines | ( |  | ) | `[private]`

| Calculates the vertical scan lines for the goals. Definition at line 402 of file SlamGoalRecognizer.cpp. References Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), Geometry::clipLineWithRectangleCohenSutherland(), ObstaclesPercept::FreePartOfGoal::directionAsAngle, ObstaclesPercept::FreePartOfGoal::wasDetermined, Vector2< V >::x, and Vector2< V >::y. Referenced by execute().

Here is the call graph for this function:

void SlamGoalRecognizer::scanLinesForGoals | ( |  | ) | `[private]`

| Scans vertical for goals. scanLineToCheckBestAngle[i] Definition at line 483 of file SlamGoalRecognizer.cpp. References ConditionalBoundary::add(), LandmarksPercept::addGoal(), ConditionalBoundary::addX(), ConditionalBoundary::addY(), Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), Geometry::calculatePointInImage(), COMPLEX_DRAWING, CORRECTED_COLOR_CLASS, 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, SlamGoalRecognizer::ColoredPartsCheck::determineLargePart(), ObstaclesPercept::FreePartOfGoal::directionAsAngle, ObstaclesPercept::FreePartOfGoal::distanceOnField, DOT, SlamGoalRecognizer::ColoredPartsCheck::firstPoint, fromDegrees(), Geometry::getDistanceBySize(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Range< double >::getSize(), ConditionalBoundary::isOnBorder(), SlamGoalRecognizer::ColoredPartsCheck::largePartBegin, SlamGoalRecognizer::ColoredPartsCheck::largePartBeginIsOnBorder, SlamGoalRecognizer::ColoredPartsCheck::largePartEnd, SlamGoalRecognizer::ColoredPartsCheck::largePartEndIsOnBorder, SlamGoalRecognizer::ColoredPartsCheck::lastPoint, ObstaclesPercept::FreePartOfGoal::leftInImage, LINE, Range< double >::max, Range< double >::min, SlamGoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, SlamGoalRecognizer::ColoredPartsCheck::numberOfLargeParts, SlamGoalRecognizer::ColoredPartsCheck::rangeOfColor, ObstaclesPercept::FreePartOfGoal::rightInImage, ObstaclesPercept::FreePartOfGoal::widthAsAngle, Boundary< double >::x, Vector2< V >::x, Vector2< int >::x, Boundary< double >::y, Vector2< V >::y, and Vector2< int >::y. Referenced by execute().

Here is the call graph for this function:

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

## Member Data Documentation

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

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

const CameraMatrix& SlamGoalRecognizer::cameraMatrix`[private]`

| A reference to the camera matrix that describes position and rotation of the camera when the image was aquired. Definition at line 123 of file SlamGoalRecognizer.h.

const CameraMatrix& SlamGoalRecognizer::prevCameraMatrix`[private]`

| A reference to the previous camera matrix that describes position and rotation of the camera when the image was aquired. Definition at line 126 of file SlamGoalRecognizer.h.

const ColorTable& SlamGoalRecognizer::colorTable`[private]`

| A reference to the color table. Definition at line 129 of file SlamGoalRecognizer.h.

int SlamGoalRecognizer::goalIndicationAboveHorizon`[private]`

| Definition at line 131 of file SlamGoalRecognizer.h.

int SlamGoalRecognizer::goalIndicationBelowHorizon`[private]`

| Definition at line 132 of file SlamGoalRecognizer.h.

bool SlamGoalRecognizer::useFixedScanLines`[private]`

| Definition at line 133 of file SlamGoalRecognizer.h.

ObstaclesPercept& SlamGoalRecognizer::obstaclesPercept`[private]`

| A reference to the obstacles percept. Definition at line 136 of file SlamGoalRecognizer.h.

LandmarksPercept& SlamGoalRecognizer::landmarksPercept`[private]`

| A reference to the obstacles percept. Definition at line 139 of file SlamGoalRecognizer.h.

const ColorCorrector& SlamGoalRecognizer::colorCorrector`[private]`

| A reference to the color corrector. Definition at line 142 of file SlamGoalRecognizer.h.

colorClass SlamGoalRecognizer::colorOfOpponentGoal`[private]`

| The color class of the opponent goal. Definition at line 145 of file SlamGoalRecognizer.h.

colorClass SlamGoalRecognizer::colorOfOwnGoal`[private]`

| The color class of the own goal. Definition at line 148 of file SlamGoalRecognizer.h.

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

| A representation of the horizon. Definition at line 151 of file SlamGoalRecognizer.h.

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

| A representation of the horizon. Definition at line 151 of file SlamGoalRecognizer.h.

int SlamGoalRecognizer::numberOfHorizontalScanLines`[private]`

| The number of horizontal scan lines. Definition at line 154 of file SlamGoalRecognizer.h.

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

| representation of the left points of the horizontal scan lines Definition at line 160 of file SlamGoalRecognizer.h.

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

| representation of the right points of the horizontal scan lines Definition at line 163 of file SlamGoalRecognizer.h.

int SlamGoalRecognizer::numberOfGoalIndications`[private]`

| the number of indications for goals Definition at line 166 of file SlamGoalRecognizer.h.

Vector2<int> SlamGoalRecognizer::goalIndicationLeft[maxNumberOfGoalScanLines]`[private]`

| left point of an indications for a goal Definition at line 169 of file SlamGoalRecognizer.h.

Vector2<int> SlamGoalRecognizer::goalIndicationCenter[maxNumberOfGoalScanLines]`[private]`

| left point of an indications for a goal Definition at line 172 of file SlamGoalRecognizer.h.

Vector2<int> SlamGoalRecognizer::goalIndicationRight[maxNumberOfGoalScanLines]`[private]`

| right point of an indication for a goal Definition at line 175 of file SlamGoalRecognizer.h.

bool SlamGoalRecognizer::leftOfGoalIndicationIsOnBorder[maxNumberOfGoalScanLines]`[private]`

| true if the left end of the goal indication is on the border of the image Definition at line 178 of file SlamGoalRecognizer.h.

bool SlamGoalRecognizer::rightOfGoalIndicationIsOnBorder[maxNumberOfGoalScanLines]`[private]`

| true if the right end of the goal indication is on the border of the image Definition at line 181 of file SlamGoalRecognizer.h.

colorClass SlamGoalRecognizer::colorOfGoalIndication[maxNumberOfGoalScanLines]`[private]`

| the color class of the goal indication Definition at line 184 of file SlamGoalRecognizer.h.

int SlamGoalRecognizer::numberOfGoalScanLines`[private]`

| The number of vertical scan lines where a goal is searched. Definition at line 187 of file SlamGoalRecognizer.h.

Vector2<int> SlamGoalRecognizer::topGoalPoint[maxNumberOfGoalScanLines]`[private]`

| representation of the top points of the goal scan lines Definition at line 190 of file SlamGoalRecognizer.h.

Vector2<int> SlamGoalRecognizer::bottomGoalPoint[maxNumberOfGoalScanLines]`[private]`

| representation of the bottom points of the goal scan lines Definition at line 193 of file SlamGoalRecognizer.h.

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

| Definition at line 195 of file SlamGoalRecognizer.h.

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

| Definition at line 198 of file SlamGoalRecognizer.h.

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

| Definition at line 201 of file SlamGoalRecognizer.h.

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

- Modules/ImageProcessor/SlamImageProcessor/SlamGoalRecognizer.h
- Modules/ImageProcessor/SlamImageProcessor/SlamGoalRecognizer.cpp