#include <GT2005GoalRecognizer.h>
Collaboration diagram for GT2005GoalRecognizer:

Public Member Functions | |
| GT2005GoalRecognizer (colorClass color, const ImageProcessorInterfaces &interfaces, const ColorCorrector &colorCorrector, const ImageInfo &horizonInfo) | |
| Initializes the GT2005GoadRecognizer. | |
| ~GT2005GoalRecognizer () | |
| Destructor. | |
| void | notifyAboutNewImage () |
| Call this method on every new image before the first call of inspect pixel. | |
| void | notifyAboutFlags () |
| Call this method to use seen flags (from the LandmarkPercept object) as areas where not to look for goals. | |
| void | notifyAboutFinish () |
| void | notifyAboutNewScanline (const Vector2< int > &scanLineStart) |
| void | inspectPixel (const Vector2< int > &point, const colorClass &color) |
Private Types | |
| enum | EdgeType { none = 0, edge, deviationWithoutEdge, imageBorder } |
| TODO: Write Summary. More... | |
| enum | ImageBorderSide { topBorder = 0, leftBorder = 1, bottomBorder = 2, rightBorder = 3, noBorder } |
| TODO: Write Summary. More... | |
| enum | FreeSide { noFreeSide, leftSide, rightSide, bothSides } |
| enum | { lockAreaStackSize = 2 } |
| Stack containing the locked area from previous goal analysises. More... | |
| enum | { maxFlagLocks = 3 } |
| HY-Ranges where flags have been detected. More... | |
| enum | { maxHypothesises = 5 } |
| Detected goal hypothesises. More... | |
Private Member Functions | |
| bool | inspectNeighbourhood (const Vector2< int > &point) |
| void | analyzeGoal (Vector2< int > startPoint) |
| point copied on purpose | |
| void | analyzeGoalpost (GT2005GoalRecognizer::EdgeDetector *detector, const Vector2< double > &directionOfEdge, bool leftGoalpost, Vector2< int > &focus, GT2005GoalRecognizer::Goalpost &result, bool *imageBorderScanned) |
| direction of edge normalized!! imageBorderScanned: to prevent that one image border is scanned again, never necessary in correct goal case | |
| void | scanCrossBar (GT2005GoalRecognizer::EdgeDetector *detector, Vector2< int > &focus, GT2005GoalRecognizer::GoalHypothesis &result, bool *imageBorderScanned) |
| GT2005GoalRecognizer::EdgeType | detectEdgeTwice (GT2005GoalRecognizer::EdgeDetector *detector, Vector2< int > &focus, BresenhamLineScan &scanLine, const Vector2< int > &scanLineOffset, int maxScanLength, EdgePointList &edgePoints) |
| scans first from focus+scanLineOffset, using detector[0]!! | |
| GT2005GoalRecognizer::EdgeType | detectEdge (GT2005GoalRecognizer::EdgeDetector &detector, Vector2< int > &focus, BresenhamLineScan &direction, int maxScanLength, int &pixelsUntilEdge) |
| GT2005GoalRecognizer::EdgeType | scanAlongLine (GT2005GoalRecognizer::EdgeDetector *detector, Vector2< int > &focus, BresenhamLineScan &scanLine, const Vector2< int > &scanLineOffset, int maximumScan, int &pixelsScanned) |
| GT2005GoalRecognizer::ImageBorderSide | scanOnImageBorder (GT2005GoalRecognizer::EdgeDetector *detector, Vector2< int > &focus, const Vector2< double > &targetDirection, int maxBorderDistance, bool *scannedSides) |
| case noBorder mustn't be ignored -> scanning hasn't been done before or doesn't make sense | |
| bool | detectGreenBelowGoalpost (Vector2< int > bottomPoint, const Vector2< double > &directionOfEdge, int goalpostHeight) |
| direction of edge normalized!! bottomPoint copied on purpose!! | |
| bool | nearImageBorder (const Vector2< int > &point, int maxDistance) |
| Returns true if the point is within one pixel distance to the image border. | |
| void | mergeFragments (bool *deletedHypothesises) |
| void | interpretResults (GT2005GoalRecognizer::EdgeDetector *detector, bool *deletedHypothesises) |
| void | publishResults (const GT2005GoalRecognizer::GoalHypothesis &goal, const bool *visibleGoalpost, const GT2005GoalRecognizer::FreeSide freeSide, const Vector2< int > &endpointOfFreePart, const bool *freePartOnImageBorder) |
| GT2005GoalRecognizer::FreeSide | detectFreePartOfGoal (GT2005GoalRecognizer::EdgeDetector *detector, const GT2005GoalRecognizer::GoalHypothesis &goal, int &freeWidth, Vector2< int > &otherSide, bool *onImageBorder) |
| void | lockArea (double x, double y, bool onGreen) |
| void | calculateLockedPixels (const Vector2< int > &scanLineStart) |
| pop lock, chekc flag intersection, calculate locked pixels | |
| void | recalculateLockedPixels (const Vector2< int > ¤tPoint) |
| Recalculates the number of locked pixels after a goal has been detected. | |
| DECLARE_DEBUG_IMAGE (imageProcessorGoal1) | |
| Declare raster image which will take debug information. | |
| DECLARE_DEBUG_IMAGE (imageProcessorGoal2) | |
| N_DECLARE_DEBUG_GRAY_SCALE_IMAGE (goalRecognizerYellow) | |
| N_DECLARE_DEBUG_GRAY_SCALE_IMAGE (goalRecognizerBlue) | |
Private Attributes | |
| const colorClass | goalColor |
| The colour class of the goal to be detected by this object. | |
| const ImageProcessorInterfaces & | interfaces |
| Collection of references to objects that are needed by this object, e.g. | |
| const ImageInfo & | horizonInfo |
| Object containing useful information related to the current horizon. | |
| const ColorCorrector & | colorCorrector |
| Reference to the color correction object. | |
| int | detectionCounter |
| Counter to detect accumulations of goal-coloured pixels. | |
| int | lockedPixels |
| Number of pixels that will not be inspected, because they are inside previously analysed areas. | |
| Vector2< double > | lockAreaStack [lockAreaStackSize] |
| int | lockAreaCount |
| Range< double > | flagLock [maxFlagLocks] |
| int | flagLockCount |
| unsigned long | frameNumberImage |
| unsigned long | frameNumberFlags |
| GoalHypothesis | hypothesis [maxHypothesises] |
| int | hypothesisCount |
Definition at line 61 of file GT2005GoalRecognizer.h.
|
|
TODO: Write Summary.
Definition at line 68 of file GT2005GoalRecognizer.h. Referenced by detectEdge(), detectEdgeTwice(), GT2005GoalRecognizer::EdgePointList::getType(), and scanAlongLine(). |
|
|
TODO: Write Summary.
Definition at line 543 of file GT2005GoalRecognizer.h. Referenced by analyzeGoalpost(), and scanOnImageBorder(). |
|
|
Definition at line 552 of file GT2005GoalRecognizer.h. Referenced by detectFreePartOfGoal(), and interpretResults(). |
|
|
Stack containing the locked area from previous goal analysises. This is to prevent that goal-coloured blobs are analysed twice. With inspectPixel being called on pixel from left to right and top to bottom, it is sufficient to store the bottom left point of the locked areas. Definition at line 808 of file GT2005GoalRecognizer.h. |
|
|
HY-Ranges where flags have been detected. Scanlines that are within that range are not scanned at all to avoid that goals are detected within flags. Definition at line 814 of file GT2005GoalRecognizer.h. |
|
|
Detected goal hypothesises.
Definition at line 821 of file GT2005GoalRecognizer.h. |
|
||||||||||||||||||||
|
Initializes the GT2005GoadRecognizer.
Definition at line 74 of file GT2005GoalRecognizer.cpp. |
|
|
Destructor.
Definition at line 573 of file GT2005GoalRecognizer.h. |
|
|
Call this method on every new image before the first call of inspect pixel.
Definition at line 82 of file GT2005GoalRecognizer.cpp. References detectionCounter, flagLockCount, Image::frameNumber, frameNumberImage, goalColor, hypothesisCount, ImageProcessorInterfaces::image, INIT_DEBUG_IMAGE, interfaces, lockAreaCount, N_INIT_DEBUG_GRAY_SCALE_IMAGE, and NDECLARE_DEBUGDRAWING. Referenced by GT2005ImageProcessor::execute(). |
|
|
Call this method to use seen flags (from the LandmarkPercept object) as areas where not to look for goals.
Definition at line 119 of file GT2005GoalRecognizer.cpp. References Flag::bottomLeft, Flag::bottomRight, flagLock, flagLockCount, LandmarksPercept::flags, LandmarksPercept::frameNumber, frameNumberFlags, ImageInfo::horizonAlignedXOf(), horizonInfo, interfaces, ImageProcessorInterfaces::landmarksPercept, Range< double >::max, maxFlagLocks, Range< double >::min, min, and LandmarksPercept::numberOfFlags. Referenced by GT2005ImageProcessor::execute(). |
Here is the call graph for this function:

|
|
Definition at line 140 of file GT2005GoalRecognizer.cpp. References DEBUG_DRAWING_FINISHED, goalColor, interpretResults(), maxHypothesises, mergeFragments(), N_SEND_DEBUG_GRAY_SCALE_IMAGE, and SEND_DEBUG_IMAGE. Referenced by GT2005ImageProcessor::execute(). |
Here is the call graph for this function:

|
|
Definition at line 592 of file GT2005GoalRecognizer.h. References calculateLockedPixels(), and detectionCounter. Referenced by GT2005ImageProcessor::scan(). |
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 603 of file GT2005GoalRecognizer.h. References analyzeGoal(), detectionCounter, goalColor, lockedPixels, N_STUPID_DEBUG_IMAGE_SET_PIXEL, point, recalculateLockedPixels(), STUPID_DEBUG_IMAGE_SET_PIXEL, Vector2< int >::x, and Vector2< int >::y. Referenced by GT2005ImageProcessor::scan(). |
Here is the call graph for this function:

|
|
Definition at line 172 of file GT2005GoalRecognizer.cpp. References ImageProcessorInterfaces::colorTable, CORRECTED_COLOR_CLASS, goalColor, Image::image, ImageProcessorInterfaces::image, interfaces, nearImageBorder(), point, Vector2< int >::x, and Vector2< int >::y. |
Here is the call graph for this function:

|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
scans first from focus+scanLineOffset, using detector[0]!!
Definition at line 652 of file GT2005GoalRecognizer.cpp. References GT2005GoalRecognizer::EdgePointList::add(), detectEdge(), EdgeType, imageBorder, and BresenhamLineScan::init(). Referenced by analyzeGoalpost(). |
Here is the call graph for this function:

|
||||||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
case noBorder mustn't be ignored -> scanning hasn't been done before or doesn't make sense
Definition at line 739 of file GT2005GoalRecognizer.cpp. References ASSERT, bottomBorder, DOT, horizonInfo, ImageBorderSide, leftBorder, LINE, ImageInfo::maxImageCoordinates, noBorder, rightBorder, scanAlongLine(), sgn, topBorder, Vector2< V >::x, Vector2< int >::x, Vector2< V >::y, and Vector2< int >::y. Referenced by analyzeGoalpost(), and scanCrossBar(). |
Here is the call graph for this function:

|
||||||||||||||||
|
direction of edge normalized!! bottomPoint copied on purpose!!
Definition at line 1241 of file GT2005GoalRecognizer.cpp. References ImageProcessorInterfaces::colorTable, CORRECTED_COLOR_CLASS, Geometry::Line::direction, BresenhamLineScan::getNext(), goalColor, horizonInfo, Image::image, ImageProcessorInterfaces::image, BresenhamLineScan::init(), interfaces, max, ImageInfo::maxImageCoordinates, N_STUPID_DEBUG_IMAGE_SET_PIXEL, STUPID_DEBUG_IMAGE_SET_PIXEL, ImageInfo::vertLine, Vector2< int >::x, Vector2< V >::x, Vector2< double >::x, Vector2< int >::y, Vector2< double >::y, and Vector2< V >::y. Referenced by analyzeGoalpost(). |
Here is the call graph for this function:

|
||||||||||||
|
Returns true if the point is within one pixel distance to the image border.
Definition at line 732 of file GT2005GoalRecognizer.h. References horizonInfo, ImageInfo::maxImageCoordinates, point, Vector2< int >::x, and Vector2< int >::y. Referenced by analyzeGoalpost(), inspectNeighbourhood(), and scanCrossBar(). |
|
|
Definition at line 1413 of file GT2005GoalRecognizer.cpp. References GT2005GoalRecognizer::GoalHypothesis::height, HORIZON_ALIGNED_RECTANGLE, horizonInfo, hypothesis, hypothesisCount, max, maxHypothesises, and min. Referenced by notifyAboutFinish(). |
|
||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||||||||||
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 1311 of file GT2005GoalRecognizer.cpp. References lockAreaCount, lockAreaStack, lockAreaStackSize, Vector2< double >::x, and Vector2< double >::y. Referenced by analyzeGoal(). |
|
|
pop lock, chekc flag intersection, calculate locked pixels
Definition at line 1347 of file GT2005GoalRecognizer.cpp. References flagLock, flagLockCount, frameNumberFlags, frameNumberImage, horizonInfo, Range< double >::isInside(), lockAreaCount, lockAreaStack, lockedPixels, max, ImageInfo::toHorizonAligned(), ImageInfo::toImageCoordinates(), Vector2< double >::x, Vector2< V >::x, Vector2< V >::y, and Vector2< double >::y. Referenced by notifyAboutNewScanline(). |
Here is the call graph for this function:

|
|
Recalculates the number of locked pixels after a goal has been detected. The scan will continue on the same scanline where it was before, so in this case it is not necessary to manage (i.e. remove) locked areas and to check if the scanline is near the flags. Definition at line 1396 of file GT2005GoalRecognizer.cpp. References ImageInfo::horizonAlignedYOf(), horizonInfo, lockAreaCount, lockAreaStack, lockedPixels, max, ImageInfo::toImageCoordinates(), Vector2< V >::x, Vector2< V >::y, and Vector2< double >::y. Referenced by inspectPixel(). |
Here is the call graph for this function:

|
|
Declare raster image which will take debug information. NB: due to the f**king macros, I have to declare both images, even though only need one per instance. |
|
|
|
|
|
|
|
|
|
|
|
The colour class of the goal to be detected by this object.
Definition at line 782 of file GT2005GoalRecognizer.h. Referenced by analyzeGoal(), detectEdge(), detectGreenBelowGoalpost(), inspectNeighbourhood(), inspectPixel(), notifyAboutFinish(), notifyAboutNewImage(), publishResults(), and scanAlongLine(). |
|
|
Collection of references to objects that are needed by this object, e.g. the current image, objects used to store the processing results, etc. Definition at line 786 of file GT2005GoalRecognizer.h. Referenced by detectEdge(), detectGreenBelowGoalpost(), inspectNeighbourhood(), notifyAboutFlags(), notifyAboutNewImage(), publishResults(), and scanAlongLine(). |
|
|
Object containing useful information related to the current horizon.
Definition at line 789 of file GT2005GoalRecognizer.h. Referenced by analyzeGoal(), analyzeGoalpost(), calculateLockedPixels(), detectEdge(), detectFreePartOfGoal(), detectGreenBelowGoalpost(), interpretResults(), mergeFragments(), nearImageBorder(), notifyAboutFlags(), publishResults(), recalculateLockedPixels(), scanAlongLine(), scanCrossBar(), and scanOnImageBorder(). |
|
|
Reference to the color correction object.
Definition at line 792 of file GT2005GoalRecognizer.h. |
|
|
Counter to detect accumulations of goal-coloured pixels. Used by the method inspectPixel. Definition at line 797 of file GT2005GoalRecognizer.h. Referenced by inspectPixel(), notifyAboutNewImage(), and notifyAboutNewScanline(). |
|
|
Number of pixels that will not be inspected, because they are inside previously analysed areas.
Definition at line 801 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), inspectPixel(), and recalculateLockedPixels(). |
|
|
Definition at line 809 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), lockArea(), and recalculateLockedPixels(). |
|
|
Definition at line 810 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), lockArea(), notifyAboutNewImage(), and recalculateLockedPixels(). |
|
|
Definition at line 815 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), and notifyAboutFlags(). |
|
|
Definition at line 816 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), notifyAboutFlags(), and notifyAboutNewImage(). |
|
|
Definition at line 817 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), and notifyAboutNewImage(). |
|
|
Definition at line 817 of file GT2005GoalRecognizer.h. Referenced by calculateLockedPixels(), and notifyAboutFlags(). |
|
|
Definition at line 822 of file GT2005GoalRecognizer.h. Referenced by analyzeGoal(), interpretResults(), and mergeFragments(). |
|
|
Definition at line 823 of file GT2005GoalRecognizer.h. Referenced by analyzeGoal(), interpretResults(), mergeFragments(), and notifyAboutNewImage(). |
1.3.6