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

# GT2005GoalRecognizer::EdgeDetector Class Reference

TODO: Write Summary. More...

Collaboration diagram for GT2005GoalRecognizer::EdgeDetector:

[legend]
List of all members.

## Public Member Functions
| EdgeDetector (colorClass target)
| Constructor.
| EdgeDetector (colorClass target, Vector3< int > referenceColor, int referenceColorBase)
EdgeType | inspectPixel (const Vector2< int > &point, int index, const colorClass &colorCls, const Vector3< int > &color)
| Investigates the next pixel and reports, wether an edge, or repeated deviation of the pixel colours (without the indications of an edge) have been detected.
Vector2< int > | getLastPointInClass ()
| Returns the last point in or near the target colour class.
void | getLastPointInClass (Vector2< int > &point)
| Similar to getLastPointInClass().
void | getLastPointInClass (Vector2< int > &point, int &index)
| Similar to getLastPointInClass(), but also returns the index of the lastPointInClass.
int | getLastIndexInClass ()
| Similar to getLastPointInClass(), but returns the index of the lastPointInClass instead of the poinst itself.
void | clear (const Vector2< int > &defaultLast, bool connectedToClass)
| Resets the edge detection state while keeping the reference colour.
void | clear ()
| Reset the edge detection state while keeping the reference colour.
void | reset ()
| Reset the reference colour and the edge detector state.
void | setReferenceColor (const Vector3< int > &color, int referenceColorBase)
| Sets the reference colour.
void | getReferenceColor (Vector3< int > &result)
| Returns the reference colour.
## Private Member Functions
int | distance (const Vector3< int > &color)
| Calculates the Mahalanobis distance of the given colour to the reference colour.
## Static Private Member Functions
Matrix3x3< int > | inverseCovarianceMatrix (colorClass goalColor)
| The inverse covariance matrix of the goal color variation (needed for the Mahalalanobis distance).
## Private Attributes
const colorClass | targetColorClass
| The colour class of the goal.
const colorClass | ignoredClassification
| Colour class that is not considered as an indication for an edge.
const Matrix3x3< int > | invCovar
| The inverse covariance matrix of the goal colour.
Vector3< int > | referenceColor
| The reference colour for distance calculations.
int | referenceColorBase
int | deviationCounter
| Counter to detect the end of an area in target colour without an edge.
int | edgeCounter
| Counter to detect an edge.
Vector2< int > | lastPointInClass
| Last pixel in the target colour class (or within tolerable distance).
int | lastPointInClassIndex
| The index of the last point in/near the target colour class.
bool | connectedToClass
| Current pixel is connected via to a pixel in the target colour class only via pixels within tolerable distance, i.e.
## Static Private Attributes
const float | classThreshold = 300000
| The maximum distance from the reference colour that is tolerated for a pixel to be considered in the target colour class.
const float | edgeThreshold = 600000
| The minimum distance from the reference colour that pixels on the other side of an edge need to have.

## Detailed Description

TODO: Write Summary.

Definition at line 79 of file GT2005GoalRecognizer.h.

## Constructor & Destructor Documentation

GT2005GoalRecognizer::EdgeDetector::EdgeDetector | ( | colorClass | target | ) |

| Constructor. Definition at line 1822 of file GT2005GoalRecognizer.cpp. References noColor.

GT2005GoalRecognizer::EdgeDetector::EdgeDetector | ( | colorClass | target,
|  | Vector3< int > | referenceColor,
|  | int | referenceColorBase
| ) |

| Definition at line 1836 of file GT2005GoalRecognizer.cpp. References noColor.

## Member Function Documentation

EdgeType GT2005GoalRecognizer::EdgeDetector::inspectPixel | ( | const Vector2< int > & | point,
|  | int | index,
|  | const colorClass & | colorCls,
|  | const Vector3< int > & | color
| ) | `[inline]`

| Investigates the next pixel and reports, wether an edge, or repeated deviation of the pixel colours (without the indications of an edge) have been detected. It is assumed that edges are quite sharp and that the color beyond the edge is significantly different to the goal colour. In case of a blurred edge or a steady color gradient the method will (eventually) return deviationWithoutEdge. Definition at line 93 of file GT2005GoalRecognizer.h. References classThreshold, connectedToClass, deviationCounter, distance(), edgeCounter, edgeThreshold, ignoredClassification, lastPointInClass, lastPointInClassIndex, noColor, point, and targetColorClass. Referenced by GT2005GoalRecognizer::detectEdge(), and GT2005GoalRecognizer::scanAlongLine().

Here is the call graph for this function:

Vector2<int> GT2005GoalRecognizer::EdgeDetector::getLastPointInClass | ( |  | ) | `[inline]`

| Returns the last point in or near the target colour class. If inspectPixel returned the value edge the returned point is located just before the edge. Definition at line 191 of file GT2005GoalRecognizer.h. References lastPointInClass. Referenced by GT2005GoalRecognizer::detectEdge().

void GT2005GoalRecognizer::EdgeDetector::getLastPointInClass | ( | Vector2< int > & | point | ) | `[inline]`

| Similar to getLastPointInClass(). Definition at line 199 of file GT2005GoalRecognizer.h. References lastPointInClass, and point.

void GT2005GoalRecognizer::EdgeDetector::getLastPointInClass | ( | Vector2< int > & | point,
|  | int & | index
| ) | `[inline]`

| Similar to getLastPointInClass(), but also returns the index of the lastPointInClass. Definition at line 208 of file GT2005GoalRecognizer.h. References lastPointInClass, lastPointInClassIndex, and point.

int GT2005GoalRecognizer::EdgeDetector::getLastIndexInClass | ( |  | ) | `[inline]`

| Similar to getLastPointInClass(), but returns the index of the lastPointInClass instead of the poinst itself. Definition at line 218 of file GT2005GoalRecognizer.h. References lastPointInClassIndex. Referenced by GT2005GoalRecognizer::scanAlongLine().

void GT2005GoalRecognizer::EdgeDetector::clear | ( | const Vector2< int > & | defaultLast,
|  | bool | connectedToClass
| ) | `[inline]`

  | Resets the edge detection state while keeping the reference colour. Parameters:
  defaultLast | The value returned by getLastPointInClass if none of the inspected pixels is in or near the target colour class.
  connectedToClass | Assume that the first pixel that is inspected is connected to the target colour class.
Definition at line 230 of file GT2005GoalRecognizer.h. References deviationCounter, edgeCounter, lastPointInClass, and lastPointInClassIndex. Referenced by GT2005GoalRecognizer::analyzeGoalpost(), GT2005GoalRecognizer::detectFreePartOfGoal(), and GT2005GoalRecognizer::scanCrossBar().

void GT2005GoalRecognizer::EdgeDetector::clear | ( |  | ) | `[inline]`

| Reset the edge detection state while keeping the reference colour. Definition at line 245 of file GT2005GoalRecognizer.h. References connectedToClass, deviationCounter, edgeCounter, and lastPointInClassIndex.

void GT2005GoalRecognizer::EdgeDetector::reset | ( | void |  | ) | `[inline]`

| Reset the reference colour and the edge detector state. Definition at line 260 of file GT2005GoalRecognizer.h. References connectedToClass, deviationCounter, edgeCounter, and lastPointInClassIndex.

void GT2005GoalRecognizer::EdgeDetector::setReferenceColor | ( | const Vector3< int > & | color,
|  | int | referenceColorBase
| ) | `[inline]`

| Sets the reference colour. Definition at line 278 of file GT2005GoalRecognizer.h. Referenced by GT2005GoalRecognizer::detectFreePartOfGoal().

void GT2005GoalRecognizer::EdgeDetector::getReferenceColor | ( | Vector3< int > & | result | ) | `[inline]`

| Returns the reference colour. Definition at line 287 of file GT2005GoalRecognizer.h. Referenced by GT2005GoalRecognizer::analyzeGoalpost().

Matrix3x3< int > GT2005GoalRecognizer::EdgeDetector::inverseCovarianceMatrix | ( | colorClass | goalColor | ) | `[static, private]`

  | The inverse covariance matrix of the goal color variation (needed for the Mahalalanobis distance). Parameters:
  goalColour | the goal colour class TODO: load these values from a file
Definition at line 1804 of file GT2005GoalRecognizer.cpp.

int GT2005GoalRecognizer::EdgeDetector::distance | ( | const Vector3< int > & | color | ) | `[inline, private]`

| Calculates the Mahalanobis distance of the given colour to the reference colour. Definition at line 305 of file GT2005GoalRecognizer.h. References invCovar. Referenced by inspectPixel().

## Member Data Documentation

const float GT2005GoalRecognizer::EdgeDetector::classThreshold = 300000`[static, private]`

| The maximum distance from the reference colour that is tolerated for a pixel to be considered in the target colour class. Definition at line 1851 of file GT2005GoalRecognizer.cpp. Referenced by inspectPixel().

const float GT2005GoalRecognizer::EdgeDetector::edgeThreshold = 600000`[static, private]`

| The minimum distance from the reference colour that pixels on the other side of an edge need to have. This value is greater than classThreshold. Definition at line 1852 of file GT2005GoalRecognizer.cpp. Referenced by inspectPixel().

const colorClass GT2005GoalRecognizer::EdgeDetector::targetColorClass`[private]`

| The colour class of the goal. Definition at line 328 of file GT2005GoalRecognizer.h. Referenced by inspectPixel().

const colorClass GT2005GoalRecognizer::EdgeDetector::ignoredClassification`[private]`

| Colour class that is not considered as an indication for an edge. Definition at line 331 of file GT2005GoalRecognizer.h. Referenced by inspectPixel().

const Matrix3x3<int> GT2005GoalRecognizer::EdgeDetector::invCovar`[private]`

| The inverse covariance matrix of the goal colour. It is used to calculate the Mahalanobis distance between the reference colour and the current colour for pixels in no colour class (or an ignored one). Definition at line 336 of file GT2005GoalRecognizer.h. Referenced by distance().

Vector3<int> GT2005GoalRecognizer::EdgeDetector::referenceColor`[private]`

| The reference colour for distance calculations. It is an average of recent pixels that were classified in the target colour class. Definition at line 340 of file GT2005GoalRecognizer.h.

int GT2005GoalRecognizer::EdgeDetector::referenceColorBase`[private]`

| Definition at line 341 of file GT2005GoalRecognizer.h.

int GT2005GoalRecognizer::EdgeDetector::deviationCounter`[private]`

| Counter to detect the end of an area in target colour without an edge. Definition at line 344 of file GT2005GoalRecognizer.h. Referenced by clear(), inspectPixel(), and reset().

int GT2005GoalRecognizer::EdgeDetector::edgeCounter`[private]`

| Counter to detect an edge. Definition at line 347 of file GT2005GoalRecognizer.h. Referenced by clear(), inspectPixel(), and reset().

Vector2<int> GT2005GoalRecognizer::EdgeDetector::lastPointInClass`[private]`

| Last pixel in the target colour class (or within tolerable distance). Definition at line 351 of file GT2005GoalRecognizer.h. Referenced by clear(), getLastPointInClass(), and inspectPixel().

int GT2005GoalRecognizer::EdgeDetector::lastPointInClassIndex`[private]`

| The index of the last point in/near the target colour class. By default, this value is -1, so it can be used to check whether any pixel was considered to be in/near the target colour class. Definition at line 356 of file GT2005GoalRecognizer.h. Referenced by clear(), getLastIndexInClass(), getLastPointInClass(), inspectPixel(), and reset().

bool GT2005GoalRecognizer::EdgeDetector::connectedToClass`[private]`

| Current pixel is connected via to a pixel in the target colour class only via pixels within tolerable distance, i.e. there hasn't been a pixel with a distance greater than the classDistance threshold since the last pixel classified in the target class (without distance). As long as this variable is true, points with tolerable distance will be stored as lastPointInClass. Definition at line 363 of file GT2005GoalRecognizer.h. Referenced by clear(), inspectPixel(), and reset().

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

- Modules/ImageProcessor/GT2005ImageProcessor/GT2005GoalRecognizer.h
- Modules/ImageProcessor/GT2005ImageProcessor/GT2005GoalRecognizer.cpp