#include <GT2004GoalRecognizer.h>
The recognizer scans horizontal lines in the image left to right. Indications for a goal are grouped and checked vertical.
Definition at line 22 of file GT2004GoalRecognizer.h.
anonymous enum [private] |
anonymous enum [private] |
GT2004GoalRecognizer::GT2004GoalRecognizer | ( | const Image & | image, | |
const CameraMatrix & | cameraMatrix, | |||
const CameraMatrix & | prevCameraMatrix, | |||
const ColorTable & | colorTable, | |||
const ColorCorrector & | colorCorrector, | |||
ObstaclesPercept & | obstaclesPercept, | |||
LandmarksPercept & | landmarksPercept | |||
) |
Definition at line 24 of file GT2004GoalRecognizer.cpp.
GT2004GoalRecognizer::~GT2004GoalRecognizer | ( | ) |
Definition at line 45 of file GT2004GoalRecognizer.cpp.
void GT2004GoalRecognizer::calculateScanLinesParallelToHorizon | ( | int | distanceAboveHorizon, | |
int | distanceBelowHorizon, | |||
int | numberOfScanLines | |||
) | [private] |
Calculates the scan lines near the horizon for the goals
Definition at line 109 of file GT2004GoalRecognizer.cpp.
References Geometry::Line::base, Geometry::Line::direction, Geometry::getIntersectionPointsOfLineAndRectangle(), and image.
void GT2004GoalRecognizer::calculateScanLinesParallelToHorizon | ( | ) | [private] |
Calculates the scan lines near the horizon for the goals
Definition at line 81 of file GT2004GoalRecognizer.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 execute().
void GT2004GoalRecognizer::calculateVerticalGoalScanLines | ( | ) | [private] |
Calculates the vertical scan lines for the goals
Definition at line 408 of file GT2004GoalRecognizer.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 execute().
GT2004GoalRecognizer::DECLARE_DEBUG_IMAGE | ( | imageProcessorGoals | ) | [private] |
void GT2004GoalRecognizer::execute | ( | ) |
Definition at line 49 of file GT2004GoalRecognizer.cpp.
References Geometry::Line::base, Player::blue, Geometry::calculateHorizon(), calculateScanLinesParallelToHorizon(), calculateVerticalGoalScanLines(), Image::cameraInfo, cameraMatrix, colorOfOpponentGoal, colorOfOwnGoal, Geometry::Line::direction, getPlayer(), goalIndicationAboveHorizon, goalIndicationBelowHorizon, horizonLine, image, INIT_DEBUG_IMAGE, scanHorizontalForGoals(), scanLinesForGoals(), SEND_DEBUG_IMAGE, skyblue, useFixedScanLines, verticalLine, Vector2< V >::x, Vector2< V >::y, and yellow.
Referenced by GT2004ImageProcessor::execute().
void GT2004GoalRecognizer::scanHorizontalForGoals | ( | ) | [private] |
Scans horizontal for goals
Definition at line 143 of file GT2004GoalRecognizer.cpp.
References ObstaclesPercept::angleToFreePartOfGoal, ObstaclesPercept::angleToFreePartOfGoalWasDetermined, Drawings::blue, Geometry::calculatePointByAngles(), Image::cameraInfo, cameraMatrix, colorOfGoalIndication, colorOfOpponentGoal, CORRECTED_COLOR_CLASS, DEBUG_IMAGE_SET_PIXEL_BLACK, DEBUG_IMAGE_SET_PIXEL_GRAY, DEBUG_IMAGE_SET_PIXEL_WHITE, GT2004GoalRecognizer::ColoredPartsCheck::determineLargePart(), DOT, GT2004GoalRecognizer::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(), GT2004GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, leftPoint, LINE, Range< T >::max, Range< T >::min, numberOfGoalIndications, numberOfHorizontalScanLines, GT2004GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, obstaclesPercept, CameraInfo::openingAngleWidth, ObstaclesPercept::opponentGoal, ObstaclesPercept::ownGoal, Drawings::ps_solid, GT2004GoalRecognizer::ColoredPartsCheck::rangeOfColor, rightOfGoalIndicationIsOnBorder, rightPoint, skyblue, Drawings::white, white, ObstaclesPercept::widthOfFreePartOfGoal, Vector2< V >::x, Vector2< V >::y, and yellow.
Referenced by execute().
void GT2004GoalRecognizer::scanLinesForGoals | ( | ) | [private] |
Scans vertical for goals
scanLineToCheckBestAngle[i]
Definition at line 488 of file GT2004GoalRecognizer.cpp.
References ConditionalBoundary::add(), LandmarksPercept::addGoal(), ConditionalBoundary::addX(), ConditionalBoundary::addY(), ObstaclesPercept::angleToFreePartOfGoalWasDetermined, Player::blue, Drawings::blue, bottomGoalPoint, Geometry::calculateAnglesForPoint(), Geometry::calculatePointByAngles(), Image::cameraInfo, cameraMatrix, colorOfGoalIndication, colorOfGoalScanLine, colorOfOpponentGoal, COMPLEX_DRAWING, CORRECTED_COLOR_CLASS, 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, GT2004GoalRecognizer::ColoredPartsCheck::determineLargePart(), distance(), ObstaclesPercept::distanceToFreePartOfGoal, DOT, LandmarksPercept::estimateOffsetForGoals(), GT2004GoalRecognizer::ColoredPartsCheck::firstPoint, fromDegrees(), Geometry::getDistanceBySize(), getPlayer(), Range< T >::getSize(), Player::getTeamColor(), goalIndicationLeft, goalIndicationRight, Image::image, image, indexOfGoalIndication, int(), ConditionalBoundary::isOnBorder(), landmarksPercept, GT2004GoalRecognizer::ColoredPartsCheck::largePartBegin, GT2004GoalRecognizer::ColoredPartsCheck::largePartBeginIsOnBorder, GT2004GoalRecognizer::ColoredPartsCheck::largePartEnd, GT2004GoalRecognizer::ColoredPartsCheck::largePartEndIsOnBorder, GT2004GoalRecognizer::ColoredPartsCheck::lastPoint, leftOfGoalIndicationIsOnBorder, Drawings::light_gray, LINE, Range< T >::max, maxNumberOfGoalScanLines, Range< T >::min, GT2004GoalRecognizer::ColoredPartsCheck::numberOfColoredPixels, numberOfGoalIndications, numberOfGoalScanLines, GT2004GoalRecognizer::ColoredPartsCheck::numberOfLargeParts, obstaclesPercept, ObstaclesPercept::opponentGoal, ObstaclesPercept::ownGoal, pink, prevCameraMatrix, Drawings::ps_solid, GT2004GoalRecognizer::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 execute().
Vector2<int> GT2004GoalRecognizer::bottomGoalPoint[maxNumberOfGoalScanLines] [private] |
representation of the bottom points of the goal scan lines
Definition at line 193 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
const CameraMatrix& GT2004GoalRecognizer::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 GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), GT2004GoalRecognizer::ColoredPartsCheck::determineLargePart(), execute(), scanHorizontalForGoals(), and scanLinesForGoals().
const ColorCorrector& GT2004GoalRecognizer::colorCorrector [private] |
A reference to the color corrector
Definition at line 142 of file GT2004GoalRecognizer.h.
colorClass GT2004GoalRecognizer::colorOfGoalIndication[maxNumberOfGoalScanLines] [private] |
the color class of the goal indication
Definition at line 184 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().
colorClass GT2004GoalRecognizer::colorOfGoalScanLine[maxNumberOfGoalScanLines] [private] |
Definition at line 201 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
The color class of the opponent goal
Definition at line 145 of file GT2004GoalRecognizer.h.
Referenced by execute(), scanHorizontalForGoals(), and scanLinesForGoals().
The color class of the own goal
Definition at line 148 of file GT2004GoalRecognizer.h.
Referenced by execute().
const ColorTable& GT2004GoalRecognizer::colorTable [private] |
A reference to the color table
Definition at line 129 of file GT2004GoalRecognizer.h.
int GT2004GoalRecognizer::goalIndicationAboveHorizon [private] |
int GT2004GoalRecognizer::goalIndicationBelowHorizon [private] |
Vector2<int> GT2004GoalRecognizer::goalIndicationCenter[maxNumberOfGoalScanLines] [private] |
left point of an indications for a goal
Definition at line 172 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanHorizontalForGoals().
Vector2<int> GT2004GoalRecognizer::goalIndicationLeft[maxNumberOfGoalScanLines] [private] |
left point of an indications for a goal
Definition at line 169 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().
Vector2<int> GT2004GoalRecognizer::goalIndicationRight[maxNumberOfGoalScanLines] [private] |
right point of an indication for a goal
Definition at line 175 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().
A representation of the horizon
Definition at line 151 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), and execute().
const Image& GT2004GoalRecognizer::image [private] |
A reference to the image that is scanned for a goal
Definition at line 120 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), calculateVerticalGoalScanLines(), execute(), scanHorizontalForGoals(), and scanLinesForGoals().
int GT2004GoalRecognizer::indexOfGoalIndication[maxNumberOfGoalScanLines] [private] |
Definition at line 198 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
A reference to the obstacles percept
Definition at line 139 of file GT2004GoalRecognizer.h.
Referenced by scanLinesForGoals().
bool GT2004GoalRecognizer::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 GT2004GoalRecognizer.h.
Referenced by scanHorizontalForGoals(), and scanLinesForGoals().
Vector2<int> GT2004GoalRecognizer::leftPoint[maxNumberOfHorizontalScanLines] [private] |
representation of the left points of the horizontal scan lines
Definition at line 160 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().
int GT2004GoalRecognizer::numberOfGoalIndications [private] |
the number of indications for goals
Definition at line 166 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), scanHorizontalForGoals(), and scanLinesForGoals().
int GT2004GoalRecognizer::numberOfGoalScanLines [private] |
The number of vertical scan lines where a goal is searched
Definition at line 187 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
int GT2004GoalRecognizer::numberOfHorizontalScanLines [private] |
The number of horizontal scan lines
Definition at line 154 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().
A reference to the obstacles percept
Definition at line 136 of file GT2004GoalRecognizer.h.
Referenced by scanHorizontalForGoals(), and scanLinesForGoals().
const CameraMatrix& GT2004GoalRecognizer::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 GT2004GoalRecognizer.h.
Referenced by scanLinesForGoals().
bool GT2004GoalRecognizer::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 GT2004GoalRecognizer.h.
Referenced by scanHorizontalForGoals(), and scanLinesForGoals().
Vector2<int> GT2004GoalRecognizer::rightPoint[maxNumberOfHorizontalScanLines] [private] |
representation of the right points of the horizontal scan lines
Definition at line 163 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), and scanHorizontalForGoals().
bool GT2004GoalRecognizer::scanLineToCheckBestAngle[maxNumberOfGoalScanLines] [private] |
Definition at line 195 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
Vector2<int> GT2004GoalRecognizer::topGoalPoint[maxNumberOfGoalScanLines] [private] |
representation of the top points of the goal scan lines
Definition at line 190 of file GT2004GoalRecognizer.h.
Referenced by calculateVerticalGoalScanLines(), and scanLinesForGoals().
bool GT2004GoalRecognizer::useFixedScanLines [private] |
Definition at line 151 of file GT2004GoalRecognizer.h.
Referenced by calculateScanLinesParallelToHorizon(), and execute().