#include <RasterSpecialist.h>
Inheritance diagram for RasterSpecialist:
Public Types | |
typedef const unsigned char * | I_Pin |
Public Member Functions | |
RasterSpecialist (RasterImageProcessor &imagePro) | |
The Constructor. | |
virtual | ~RasterSpecialist () |
The Destructor. | |
virtual int | getType ()=0 |
getter for the type of specialist | |
virtual void | init ()=0 |
Initializes the specialist before running the detection algorithm. | |
virtual void | executePostProcessing () |
Executes the detection algorithm. | |
virtual 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 void | invokeOnPostScan (int x, int y) |
Invokes the specialist in the second scan stage at position (x,y) (this member should be replaced later). | |
Public Attributes | |
bool | preScanNeeded |
Tells if the specialist should be invoked in the pre-scan. | |
bool | postScanNeeded |
Tells if the specialist should be invoked in the post-scan. | |
Protected Member Functions | |
void | createSegmentsFromLines (std::list< LinePair > &lines, std::vector< std::list< LinePair > > &segments, int spaceX, int spaceY) |
Runs a algorithm to cluster line pairs that might belong to one region (segment). | |
bool | createSegmentsFromLines2 (std::list< LinePair > &lines, std::vector< std::list< LinePair > > &segments, int xSpace, int ySpace) |
Runs a algorithm to cluster line pairs that might belong to one region (segment). | |
bool | createGridSegments (std::list< GridLP > &lines, std::vector< std::list< GridLP > > &segments, int xSpace, int ySpace) |
Runs a algorithm to cluster GridLPs that might belong to one region (segment). | |
bool | doColorSegmentation (std::vector< LinePair > &lines, std::vector< std::vector< LinePair > > &segments, int xSpace, int ySpace) |
Runs a algorithm to cluster line pairs that might belong to one region (segment). | |
void | createConvexPoly (std::list< LinePair > &input, std::vector< Vector2< int > > output) |
precondition: Lines must be sorted in increasing y - order. | |
colorClass | getColor (Vector2< int > v) |
Implemented with ColorTable interface. | |
colorClass | getColor (int x, int y) |
Implemented with ColorTable interface. | |
bool | checkColor (int x, int y, colorClass color) |
Implemented with ColorTable interface. | |
bool | checkColor (Vector2< int > v, colorClass color) |
Implemented with ColorTable interface. | |
Vector2< int > | scanNorth (int x, int y) |
Scans to the top, until the colorClass(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanSouth (int x, int y) |
Scans to the bottom, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanWest (int x, int y) |
Scans to the right side, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanEast (int x, int y) |
Scans to the left side, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanNW (int x, int y) |
Scans to top left, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanSW (int x, int y) |
Scans to down left, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanSE (int x, int y) |
Scans to down right, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scanNE (int x, int y) |
Scans to top right, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scan (Vector2< int > v, short direction) |
Scans to the give direction, until getColor(x,y) changes or the border of the image is reached. | |
Vector2< int > | scan (Vector2< int > v, short direction, colorClass search) |
Scans in the given direction and stops if the given color is found or the border of the image is reached. | |
Vector2< int > | scan (int x, int y, short direction) |
Scans in the given direction and stops if color changes. | |
float | getDistanceToLine (const Geometry::Line line, const Vector2< int > &point) |
Calculates the distance to the line. | |
double | theta (Vector2< int > &v1, Vector2< int > &v2) |
The theta function for the difference of two vectors. | |
double | theta (Vector2< int > &v) |
The theta function. | |
int | sign (int value) |
Helper. | |
Protected Attributes | |
RasterImageProcessor * | rip |
Holds the related image processor. | |
int const | imageHeight |
Holds the height of the image. | |
int const | imageWidth |
Holds the width of the image. | |
Vector2< int > | errorDummy |
A helper variable. | |
Private Member Functions | |
bool | linePairsFit (LinePair &inSegment,LinePair &newPair, int allowedSpace) |
Tests if two runs have a distance smaller than the allowed space. | |
bool | gridFit (GridLP &inSegment,GridLP &newPair, int allowedSpace) |
Tests if two runs have a distance smaller than the allowed space. | |
bool | linesFit (LinePair &inSegment,LinePair &newPair, int allowedSpace) |
Tests if two runs have a distance smaller than the allowed space and if their color is the same. | |
Private Attributes | |
int | currentX |
A temporary variable for the direction offset. | |
int | currentY |
A temporary variable for the direction offset. | |
colorClass | search |
A temporary variable. | |
int const | Y_VALUE |
Offset value for Y channel. | |
int const | U_VALUE |
Offset value for U channel. | |
int const | V_VALUE |
Offset value for V channel. | |
std::list< std::list< LinePair > > | segList |
List for segmentation functions. |
A RasterSpecialist is detecting shapes in the image.
Definition at line 36 of file RasterSpecialist.h.
|
Reimplemented in REnemySpecialist. Definition at line 199 of file RasterSpecialist.h. |
|
The Constructor. For creation the RasterImageProcessor is needed.
Definition at line 14 of file RasterSpecialist.cpp. References cameraResolutionHeight_ERS7, cameraResolutionWidth_ERS7, postScanNeeded, preScanNeeded, and Y_VALUE. |
|
The Destructor.
Definition at line 26 of file RasterSpecialist.cpp. |
|
getter for the type of specialist
Implemented in BoxSpecialist, RBallSpecialist2, RBridgeSpecialist, REnemySpecialist, and RFieldSpecialist. Referenced by RasterImageProcessor::setSpecialist(). |
|
Initializes the specialist before running the detection algorithm.
Implemented in BoxSpecialist, RBallSpecialist2, RBridgeSpecialist, REnemySpecialist, and RFieldSpecialist. |
|
Executes the detection algorithm.
Reimplemented in BoxSpecialist, RBallSpecialist2, RBridgeSpecialist, REnemySpecialist, and RFieldSpecialist. Definition at line 216 of file RasterSpecialist.h. |
|
Invokes the specialist in the first scan stage at position (x,y) (this member should be replaced later).
Reimplemented in BoxSpecialist, RBallSpecialist2, RBridgeSpecialist, REnemySpecialist, and RFieldSpecialist. Definition at line 222 of file RasterSpecialist.h. |
|
Invokes the specialist in the second scan stage at position (x,y) (this member should be replaced later).
Reimplemented in BoxSpecialist, RBallSpecialist2, RBridgeSpecialist, REnemySpecialist, and RFieldSpecialist. Definition at line 228 of file RasterSpecialist.h. |
|
Runs a algorithm to cluster line pairs that might belong to one region (segment). preconstraint: Lines must be sorted in increasing x - order
Definition at line 218 of file RasterSpecialist.cpp. References idText, linePairsFit(), OUTPUT, segList, RasterSpecialist::LinePair::v1, and Vector2< int >::y. |
Here is the call graph for this function:
|
Runs a algorithm to cluster line pairs that might belong to one region (segment). preconstraint: Lines must be sorted in increasing y - order
Definition at line 135 of file RasterSpecialist.cpp. References linePairsFit(). Referenced by REnemySpecialist::executePostProcessing(), RBridgeSpecialist::executePostProcessing(), RBallSpecialist2::executePostProcessing(), and BoxSpecialist::executePostProcessing(). |
Here is the call graph for this function:
|
Runs a algorithm to cluster GridLPs that might belong to one region (segment). The segmantation process is calculated in the coordinate system of the grid. preconstraint: Lines must be sorted in increasing y - order
Definition at line 55 of file RasterSpecialist.cpp. References gridFit(). |
Here is the call graph for this function:
|
Runs a algorithm to cluster line pairs that might belong to one region (segment). Two line pairs only will belong to one region, if the color of the two line pairs is the same. preconstraint: Lines must be sorted in increasing y - order
Definition at line 335 of file RasterSpecialist.cpp. References idText, linesFit(), and OUTPUT. |
Here is the call graph for this function:
|
precondition: Lines must be sorted in increasing y - order.
Definition at line 416 of file RasterSpecialist.cpp. References theta(). |
Here is the call graph for this function:
|
Implemented with ColorTable interface.
Definition at line 310 of file RasterSpecialist.h. References colorClass, Vector2< V >::x, and Vector2< V >::y. Referenced by checkColor(), BoxSpecialist::createBBox(), REnemySpecialist::executePostProcessing(), RBridgeSpecialist::findBridgeMark(), RBridgeSpecialist::getPosition(), RBridgeSpecialist::invokeOnPreScan(), BoxSpecialist::invokeOnPreScan(), scan(), scanEast(), scanNE(), scanNorth(), scanNW(), scanSE(), scanSouth(), scanSW(), scanWest(), and RBallSpecialist2::validateCircle(). |
|
Implemented with ColorTable interface.
Definition at line 318 of file RasterSpecialist.h. References colorClass, ImageProcessorInterfaces::colorTable, ColorCorrector::correct(), ColorTable::getColorClass(), Image::image, and ImageProcessorInterfaces::image. |
Here is the call graph for this function:
|
Implemented with ColorTable interface.
Definition at line 331 of file RasterSpecialist.h. References getColor(). Referenced by scan(), scanEast(), scanNE(), scanNorth(), scanNW(), scanSE(), scanSouth(), scanSW(), and scanWest(). |
Here is the call graph for this function:
|
Implemented with ColorTable interface.
Definition at line 339 of file RasterSpecialist.h. References getColor(), Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to the top, until the colorClass(x,y) changes or the border of the image is reached.
Definition at line 351 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to the bottom, until getColor(x,y) changes or the border of the image is reached.
Definition at line 368 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to the right side, until getColor(x,y) changes or the border of the image is reached.
Definition at line 383 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. Referenced by RBridgeSpecialist::invokeOnPreScan(). |
Here is the call graph for this function:
|
Scans to the left side, until getColor(x,y) changes or the border of the image is reached.
Definition at line 398 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. Referenced by RBridgeSpecialist::invokeOnPreScan(). |
Here is the call graph for this function:
|
Scans to top left, until getColor(x,y) changes or the border of the image is reached.
Definition at line 412 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to down left, until getColor(x,y) changes or the border of the image is reached.
Definition at line 430 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to down right, until getColor(x,y) changes or the border of the image is reached.
Definition at line 448 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to top right, until getColor(x,y) changes or the border of the image is reached.
Definition at line 465 of file RasterSpecialist.h. References checkColor(), getColor(), search, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans to the give direction, until getColor(x,y) changes or the border of the image is reached.
Definition at line 482 of file RasterSpecialist.h. References checkColor(), currentX, currentY, errorDummy, getColor(), search, Vector2< V >::x, and Vector2< V >::y. Referenced by scan(). |
Here is the call graph for this function:
|
Scans in the given direction and stops if the given color is found or the border of the image is reached.
Definition at line 540 of file RasterSpecialist.h. References checkColor(), currentX, currentY, errorDummy, Vector2< V >::x, and Vector2< V >::y. |
Here is the call graph for this function:
|
Scans in the given direction and stops if color changes.
Definition at line 594 of file RasterSpecialist.h. References scan(). |
Here is the call graph for this function:
|
Calculates the distance to the line.
Definition at line 602 of file RasterSpecialist.h. References Geometry::Line::base, Geometry::Line::direction, Geometry::distance(), Vector2< V >::normalize(), point, Vector2< V >::x, Vector2< double >::x, Vector2< int >::x, Vector2< V >::y, Vector2< double >::y, and Vector2< int >::y. Referenced by RBridgeSpecialist::createBBox(), BoxSpecialist::createBBox(), RBridgeSpecialist::findBridgeMark(), and BoxSpecialist::searchGoal(). |
Here is the call graph for this function:
|
The theta function for the difference of two vectors.
Definition at line 623 of file RasterSpecialist.h. References Vector2< V >::x, and Vector2< V >::y. Referenced by createConvexPoly(). |
|
The theta function.
Definition at line 639 of file RasterSpecialist.h. References Vector2< V >::x, and Vector2< V >::y. |
|
Helper.
Definition at line 653 of file RasterSpecialist.h. |
|
Tests if two runs have a distance smaller than the allowed space.
Definition at line 680 of file RasterSpecialist.h. References RasterSpecialist::LinePair::v1, RasterSpecialist::LinePair::v2, and Vector2< int >::x. Referenced by createSegmentsFromLines(), and createSegmentsFromLines2(). |
|
Tests if two runs have a distance smaller than the allowed space.
Definition at line 691 of file RasterSpecialist.h. References RasterSpecialist::GridLP::d1, and RasterSpecialist::GridLP::d2. Referenced by createGridSegments(). |
|
Tests if two runs have a distance smaller than the allowed space and if their color is the same.
Definition at line 704 of file RasterSpecialist.h. References RasterSpecialist::LinePair::color, RasterSpecialist::LinePair::v1, RasterSpecialist::LinePair::v2, and Vector2< int >::x. Referenced by doColorSegmentation(). |
|
Tells if the specialist should be invoked in the pre-scan.
Definition at line 231 of file RasterSpecialist.h. Referenced by RDefaultStrategy::init(), RDefaultStrategy::preScan(), and RasterSpecialist(). |
|
Tells if the specialist should be invoked in the post-scan.
Definition at line 233 of file RasterSpecialist.h. Referenced by RasterSpecialist(). |
|
Holds the related image processor.
Definition at line 237 of file RasterSpecialist.h. |
|
Holds the height of the image.
Definition at line 239 of file RasterSpecialist.h. |
|
Holds the width of the image.
Definition at line 241 of file RasterSpecialist.h. |
|
A helper variable.
Definition at line 243 of file RasterSpecialist.h. Referenced by scan(). |
|
A temporary variable for the direction offset.
Definition at line 659 of file RasterSpecialist.h. Referenced by scan(). |
|
A temporary variable for the direction offset.
Definition at line 661 of file RasterSpecialist.h. Referenced by scan(). |
|
A temporary variable.
Definition at line 663 of file RasterSpecialist.h. Referenced by scan(), scanEast(), scanNE(), scanNorth(), scanNW(), scanSE(), scanSouth(), scanSW(), and scanWest(). |
|
Offset value for Y channel.
Definition at line 665 of file RasterSpecialist.h. |
|
Offset value for U channel.
Definition at line 667 of file RasterSpecialist.h. |
|
Offset value for V channel.
Definition at line 669 of file RasterSpecialist.h. |
|
List for segmentation functions.
Definition at line 671 of file RasterSpecialist.h. Referenced by createSegmentsFromLines(). |