#include <RBallSpecialist2.h>
Inheritance diagram for RBallSpecialist2:
Public Member Functions | |
RBallSpecialist2 (RasterImageProcessor &processor, RasterStrategy &strategy) | |
Constructor. | |
virtual | ~RBallSpecialist2 () |
Destructor. | |
void | invokeOnPostScan (int x, int y) |
Invokes the specialist in the second scan stage at position (x,y) (this member should be replaced later). | |
void | executePostProcessing () |
Executes the detection algorithm. | |
void | invokeOnPreScan (int x, int y) |
Invokes the specialist in the first scan stage at position (x,y) (this member should be replaced later). | |
virtual int | getType () |
Getter for the type. | |
virtual void | init () |
Initializes the specialist. | |
double | validateCircle (Geometry::Circle &circle) |
Validates the circle, by comparing it to a color pattern. | |
double | validateEdgePoints (Geometry::Circle &circle) |
Validates the circle, by calculating the percantage of edge points near the circle. | |
void | getCoordinatesByAngle (double angle, double &x, double &y) |
Calculates the coordinates of a vector that looks in direction angle. | |
Public Attributes | |
Vector2< int > | temp |
A temporary variable. | |
std::list< LinePair > | rows |
The runs to analyze. | |
Private Types | |
enum | { MAX_EDGE_POINTS = 30, MAX_CIRCLE_DIST = 2, EDGE_THR = 30, SCAN_THR = 30 } |
Private Member Functions | |
void | addBallPercept (Geometry::Circle &circle, double validity) |
Adds the Ball to the BallPercept. | |
double | calculateSmallCircle (Geometry::Circle &circle) |
Approximates a circle for small regions. | |
double | calculateCircleByEdges (Geometry::Circle &circle) |
Approximates the circle with a randomized algorithm. | |
double | calculateLargeCircle (const Box &input, Geometry::Circle &circle) |
Approximates the circle with a randomized algorithm. | |
bool | filterBallPoints (std::list< LinePair > &segment) |
Filters the edge points with a contrast filter. | |
bool | createBox (std::list< LinePair > &segment, Box &box) |
Builds a bounding box for a segment. | |
double | middleEdgePointDist (Geometry::Circle &circle) |
Calculates the average distance of the edge points to the circle. | |
bool | isEdge (int x, int y) |
The function defines a filter used in filterBallPoints(). | |
void | setThreshold (int threshold) |
Setter for the edge filter threshold. | |
Private Attributes | |
RasterStrategy * | strategy |
The strategy. | |
REdgeDetection | edgeScanner |
The edge detector. | |
int | threshold |
The normal threshold. | |
int | minEdgeThreshold |
The threshold for large balls. | |
std::vector< Vector2< int > > | points |
A buffer for the edge points of a region. | |
int | numberOfEdgePoints |
The number of edge points. | |
double | roundness |
The roundness of the last detected circle. |
Definition at line 29 of file RBallSpecialist2.h.
|
Definition at line 32 of file RBallSpecialist2.h. |
|
Constructor.
Definition at line 19 of file RBallSpecialist2.cpp. References InFile::exists(), getLocation(), idText, minEdgeThreshold, and OUTPUT. |
Here is the call graph for this function:
|
Destructor.
Definition at line 47 of file RBallSpecialist2.cpp. |
|
Invokes the specialist in the second scan stage at position (x,y) (this member should be replaced later).
Reimplemented from RasterSpecialist. Definition at line 114 of file RBallSpecialist2.cpp. |
|
Executes the detection algorithm.
Reimplemented from RasterSpecialist. Definition at line 52 of file RBallSpecialist2.cpp. References addBallPercept(), calculateCircleByEdges(), calculateLargeCircle(), calculateSmallCircle(), Image::cameraInfo, createBox(), RasterSpecialist::createSegmentsFromLines2(), filterBallPoints(), ImageProcessorInterfaces::image, RasterSpecialist::Box::maxX, RasterSpecialist::Box::maxY, minEdgeThreshold, RasterSpecialist::Box::minX, RasterSpecialist::Box::minY, numberOfEdgePoints, CameraInfo::resolutionHeight, rows, and REdgeDetection::threshold. Referenced by RDefaultStrategy::postProcessing(). |
Here is the call graph for this function:
|
Invokes the specialist in the first scan stage at position (x,y) (this member should be replaced later).
Reimplemented from RasterSpecialist. Definition at line 96 of file RBallSpecialist2.cpp. References RasterStrategy::insideBall, LINE, rows, and temp. Referenced by RDefaultStrategy::checkBall(), and RDefaultStrategy::preScan(). |
|
Getter for the type.
Implements RasterSpecialist. Definition at line 118 of file RBallSpecialist2.cpp. References __RBallSpecialist. |
|
Initializes the specialist.
Implements RasterSpecialist. Definition at line 123 of file RBallSpecialist2.cpp. References minEdgeThreshold, roundness, rows, and REdgeDetection::threshold. Referenced by RDefaultStrategy::init(). |
|
Validates the circle, by comparing it to a color pattern.
Definition at line 187 of file RBallSpecialist2.cpp. References Image::cameraInfo, Geometry::Circle::center, colorClass, DOT, RasterSpecialist::getColor(), ImageProcessorInterfaces::image, Geometry::insideCircle(), Geometry::Circle::radius, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< double >::x, and Vector2< double >::y. Referenced by calculateCircleByEdges(), and calculateSmallCircle(). |
Here is the call graph for this function:
|
Validates the circle, by calculating the percantage of edge points near the circle.
Definition at line 326 of file RBallSpecialist2.cpp. References Geometry::Circle::center, MAX_CIRCLE_DIST, numberOfEdgePoints, and Geometry::Circle::radius. Referenced by calculateCircleByEdges(). |
|
Calculates the coordinates of a vector that looks in direction angle. Only a helper.
Definition at line 82 of file RBallSpecialist2.h. Referenced by calculateLargeCircle(). |
|
Adds the Ball to the BallPercept. Makes some small tests befor generating a percept.
Definition at line 135 of file RBallSpecialist2.cpp. References BallPercept::add(), ImageProcessorInterfaces::ballPercept, Geometry::calculateAnglesForPoint(), Geometry::calculatePointOnField(), Image::cameraInfo, ImageProcessorInterfaces::cameraMatrix, Geometry::Circle::center, CIRCLE, Geometry::getDistanceToLine(), RasterImageProcessor::getHorizon(), ImageProcessorInterfaces::image, CameraMatrix::isValid, Geometry::Circle::radius, roundness, Pose3D::translation, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
Approximates a circle for small regions.
Definition at line 469 of file RBallSpecialist2.cpp. References Geometry::Circle::center, Geometry::getCircle(), numberOfEdgePoints, Geometry::Circle::radius, roundness, validateCircle(), Vector2< double >::x, and Vector2< double >::y. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
Approximates the circle with a randomized algorithm.
Definition at line 354 of file RBallSpecialist2.cpp. References Geometry::getCircle(), middleEdgePointDist(), numberOfEdgePoints, roundness, validateCircle(), and validateEdgePoints(). Referenced by calculateLargeCircle(), and executePostProcessing(). |
Here is the call graph for this function:
|
Approximates the circle with a randomized algorithm. Edge points are filtered with a star scan, which has its origin in the center of the box.
Definition at line 430 of file RBallSpecialist2.cpp. References calculateCircleByEdges(), getCoordinatesByAngle(), LINE, MAX_EDGE_POINTS, numberOfEdgePoints, pi2, REdgeDetection::scan(), Vector2< V >::x, and Vector2< V >::y. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
Filters the edge points with a contrast filter.
Definition at line 270 of file RBallSpecialist2.cpp. References DOT, isEdge(), MAX_EDGE_POINTS, numberOfEdgePoints, temp, and Vector2< int >::y. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
Builds a bounding box for a segment.
Definition at line 382 of file RBallSpecialist2.cpp. References LINE, RasterSpecialist::Box::maxX, RasterSpecialist::Box::maxY, RasterSpecialist::Box::minX, RasterSpecialist::Box::minY, temp, and Vector2< int >::y. Referenced by executePostProcessing(). |
|
Calculates the average distance of the edge points to the circle.
Definition at line 341 of file RBallSpecialist2.cpp. References Geometry::Circle::center, numberOfEdgePoints, and Geometry::Circle::radius. Referenced by calculateCircleByEdges(). |
|
The function defines a filter used in filterBallPoints().
Definition at line 165 of file RBallSpecialist2.h. References REdgeDetection::isHorizontalEdge(), and REdgeDetection::isVerticalEdge(). Referenced by filterBallPoints(). |
Here is the call graph for this function:
|
Setter for the edge filter threshold.
Definition at line 505 of file RBallSpecialist2.cpp. |
|
A temporary variable.
Definition at line 88 of file RBallSpecialist2.h. Referenced by createBox(), filterBallPoints(), and invokeOnPreScan(). |
|
The runs to analyze.
Definition at line 90 of file RBallSpecialist2.h. Referenced by executePostProcessing(), init(), and invokeOnPreScan(). |
|
The strategy.
Definition at line 94 of file RBallSpecialist2.h. |
|
The edge detector.
Definition at line 99 of file RBallSpecialist2.h. |
|
The normal threshold.
Definition at line 101 of file RBallSpecialist2.h. |
|
The threshold for large balls.
Definition at line 103 of file RBallSpecialist2.h. Referenced by executePostProcessing(), init(), and RBallSpecialist2(). |
|
A buffer for the edge points of a region.
Definition at line 153 of file RBallSpecialist2.h. |
|
The number of edge points.
Definition at line 155 of file RBallSpecialist2.h. Referenced by calculateCircleByEdges(), calculateLargeCircle(), calculateSmallCircle(), executePostProcessing(), filterBallPoints(), middleEdgePointDist(), and validateEdgePoints(). |
|
The roundness of the last detected circle.
Definition at line 157 of file RBallSpecialist2.h. Referenced by addBallPercept(), calculateCircleByEdges(), calculateSmallCircle(), and init(). |