#include <BoxSpecialist.h>
Inheritance diagram for BoxSpecialist:
Public Types | |
typedef Geometry::Line | Line |
typedef vector< list< RasterSpecialist::LinePair > > | SVector |
Public Member Functions | |
BoxSpecialist (RasterImageProcessor &processor, RasterStrategy &strategy) | |
Constructor. | |
virtual | ~BoxSpecialist () |
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 member type. | |
virtual void | init () |
Initializes the specialist. | |
Private Member Functions | |
void | createBBox () |
Creates the bounding box aligned to the horizon for each region. | |
bool | searchGoal (SegmentInfo &goal) |
The goal detection algorithm. | |
bool | searchLandmark (SegmentInfo &flag) |
The detection algorithm for landmarks. | |
void | fitLandmark (SegmentInfo &flag) |
This function detects the accurate shape of a landmark. | |
void | detectFreePartOfGoal () |
Detects the free part of the goal and generates a percept. | |
void | fusionGoal () |
Fusions the regions that belong to the same goal. | |
void | mergeBoxes (SegmentInfo &seg1, SegmentInfo &seg2) |
Merges two regions. | |
void | countColors (SegmentInfo &si, list< LinePair > &segment) |
Counts the colors of segment si. | |
bool | missingData (bool ulc, bool urc, bool brc, bool blc, int i) |
A small test for goals. | |
void | calculateAnglesForPoint (const Vector2< double > &point, const CameraMatrix &cameraMatrix, const CameraInfo &cameraInfo, Vector2< double > &angles) |
bool | calculatePointOnField (const double x, const double y, const CameraMatrix &cameraMatrix, const CameraInfo &cameraInfo, Vector2< int > &pointOnField) |
void | createValidities (SegmentInfo &info) |
Creates the validity values for the different kinds of objects. | |
Private Attributes | |
RasterStrategy * | strategy |
The strategy. | |
REdgeDetection | edgeScanner |
The edge detector. | |
std::list< LinePair > | lst_pts |
List of LinePairs. | |
Geometry::Line | horizon |
The calculated horizon. | |
Geometry::Line | pHorizon |
The calculated perpendicular to the horizon. | |
int | flagThreshold |
The threshold for edge-scans of the landmark detection. | |
int | goalThreshold |
The threshold for edge-scans of the goal detection. | |
Vector2< int > | left_border |
A temporary variable. | |
std::vector< list< LinePair > > | segments_img |
The clustered runs. | |
std::vector< SegmentInfo > | infos_img |
The calculated informations about the segments. | |
std::vector< Vector2< int > > | bottomPoints |
The bottomPoints of the goal (edges from green to yellow or skyblue). |
Definition at line 27 of file BoxSpecialist.h.
|
Definition at line 74 of file BoxSpecialist.h. |
|
Definition at line 75 of file BoxSpecialist.h. |
|
Constructor.
Definition at line 21 of file BoxSpecialist.cpp. References edgeScanner, InFile::exists(), flagThreshold, getLocation(), goalThreshold, idText, OUTPUT, and strategy. |
Here is the call graph for this function:
|
Destructor.
Definition at line 46 of file BoxSpecialist.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 729 of file BoxSpecialist.cpp. References bottomPoints. Referenced by RDefaultStrategy::postScan(). |
|
Executes the detection algorithm.
Reimplemented from RasterSpecialist. Definition at line 734 of file BoxSpecialist.cpp. References Geometry::Line::base, ImageProcessorInterfaces::cameraMatrix, createBBox(), RasterSpecialist::createSegmentsFromLines2(), Geometry::Line::direction, edgeScanner, LandmarksPercept::estimateOffsetForFlags(), LandmarksPercept::estimateOffsetForGoals(), flagThreshold, RasterImageProcessor::getHorizon(), goalThreshold, infos_img, ImageProcessorInterfaces::landmarksPercept, LINE, lst_pts, pHorizon, Vector2< double >::rotateLeft(), searchGoal(), searchLandmark(), segments_img, REdgeDetection::threshold, Pose3D::translation, Vector3< double >::x, and Vector3< double >::y. 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 165 of file BoxSpecialist.cpp. References edgeScanner, RasterSpecialist::getColor(), RasterStrategy::insideBox, left_border, LINE, lst_pts, REdgeDetection::scanEast(), REdgeDetection::scanWest(), and strategy. Referenced by RDefaultStrategy::checkBox(), and RDefaultStrategy::preScan(). |
Here is the call graph for this function:
|
Getter for member type.
Implements RasterSpecialist. Definition at line 49 of file BoxSpecialist.cpp. References __RBoxSpecialist. |
|
Initializes the specialist.
Implements RasterSpecialist. Definition at line 53 of file BoxSpecialist.cpp. References bottomPoints, edgeScanner, infos_img, lst_pts, segments_img, and REdgeDetection::threshold. Referenced by RDefaultStrategy::init(). |
|
Creates the bounding box aligned to the horizon for each region.
Definition at line 63 of file BoxSpecialist.cpp. References Geometry::Line::base, BoxSpecialist::SegmentInfo::bottomColor, BoxSpecialist::Rectangle::bottomLeft, BoxSpecialist::Rectangle::bottomRight, BoxSpecialist::Rectangle::center, countColors(), createValidities(), Geometry::Line::direction, RasterSpecialist::getColor(), RasterSpecialist::getDistanceToLine(), Geometry::getIntersectionOfLines(), infos_img, pHorizon, BoxSpecialist::SegmentInfo::rect, BoxSpecialist::SegmentInfo::segment, segments_img, BoxSpecialist::SegmentInfo::size, BoxSpecialist::SegmentInfo::topColor, BoxSpecialist::Rectangle::upperLeft, BoxSpecialist::Rectangle::upperRight, Vector2< V >::x, and Vector2< V >::y. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
Here is the call graph for this function:
|
The detection algorithm for landmarks. If one is found a percept will be generated.
Definition at line 469 of file BoxSpecialist.cpp. References Vector2< V >::abs(), RasterImageProcessor::addFlag(), BoxSpecialist::Rectangle::bottomLeft, BoxSpecialist::Rectangle::bottomRight, BoxSpecialist::Rectangle::center, colorClass, REdgeDetection::colorScan(), Geometry::Line::direction, DOT, edgeScanner, noColor, north, pHorizon, BoxSpecialist::SegmentInfo::pink, BoxSpecialist::SegmentInfo::rect, REdgeDetection::scan(), REdgeDetection::setDirection(), REdgeDetection::skip(), BoxSpecialist::SegmentInfo::skyblue, BoxSpecialist::Rectangle::upperLeft, BoxSpecialist::Rectangle::upperRight, west, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, Vector2< double >::y, and BoxSpecialist::SegmentInfo::yellow. Referenced by executePostProcessing(). |
Here is the call graph for this function:
|
This function detects the accurate shape of a landmark.
Definition at line 678 of file BoxSpecialist.cpp. References BoxSpecialist::Rectangle::bottomLeft, BoxSpecialist::Rectangle::center, Geometry::Line::direction, DOT, edgeScanner, north, pHorizon, BoxSpecialist::SegmentInfo::rect, REdgeDetection::scan(), REdgeDetection::skip(), BoxSpecialist::Rectangle::upperLeft, west, Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y. |
Here is the call graph for this function:
|
Detects the free part of the goal and generates a percept. This function is not completed yet. Definition at line 1108 of file BoxSpecialist.cpp. References ObstaclesPercept::angleToFreePartOfGoal, ObstaclesPercept::angleToFreePartOfGoalWasDetermined, bottomPoints, Geometry::calculateAnglesForPoint(), Image::cameraInfo, ImageProcessorInterfaces::cameraMatrix, ObstaclesPercept::distanceToFreePartOfGoal, ImageProcessorInterfaces::image, LINE, ImageProcessorInterfaces::obstaclesPercept, pi, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Pose3D::translation, ObstaclesPercept::widthOfFreePartOfGoal, Vector3< double >::x, Vector2< V >::x, Vector2< V >::y, and Vector3< double >::y. |
Here is the call graph for this function:
|
Fusions the regions that belong to the same goal. This function is not completed yet. But the algorithm is tested. Definition at line 885 of file BoxSpecialist.cpp. References LandmarksPercept::addGoal(), ConditionalBoundary::addX(), ConditionalBoundary::addY(), BoxSpecialist::SegmentInfo::bottomColor, BoxSpecialist::Rectangle::bottomLeft, BoxSpecialist::Rectangle::bottomRight, calculateAnglesForPoint(), Image::cameraInfo, ImageProcessorInterfaces::cameraMatrix, BoxSpecialist::Rectangle::center, colorClass, Geometry::getDistanceToLine(), getPlayer(), Player::getTeamColor(), BoxSpecialist::SegmentInfo::goalValidity, ImageProcessorInterfaces::image, infos_img, RasterSpecialist::Box::inside(), ImageProcessorInterfaces::landmarksPercept, LINE, mergeBoxes(), missingData(), BoxSpecialist::SegmentInfo::pink, BoxSpecialist::SegmentInfo::rect, searchGoal(), BoxSpecialist::SegmentInfo::skyblue, BoxSpecialist::Rectangle::upperLeft, BoxSpecialist::Rectangle::upperRight, Vector2< double >::x, Vector2< double >::y, and BoxSpecialist::SegmentInfo::yellow. |
Here is the call graph for this function:
|
Merges two regions. The result is stored in seg1.
Definition at line 809 of file BoxSpecialist.cpp. References Geometry::Line::base, BoxSpecialist::Rectangle::bottomLeft, BoxSpecialist::Rectangle::bottomRight, BoxSpecialist::Rectangle::center, Geometry::Line::direction, Geometry::getDistanceToLine(), Geometry::getIntersectionOfLines(), pHorizon, BoxSpecialist::SegmentInfo::pink, BoxSpecialist::SegmentInfo::rect, BoxSpecialist::SegmentInfo::size, BoxSpecialist::SegmentInfo::skyblue, BoxSpecialist::Rectangle::upperLeft, BoxSpecialist::Rectangle::upperRight, and BoxSpecialist::SegmentInfo::yellow. Referenced by fusionGoal(). |
Here is the call graph for this function:
|
Counts the colors of segment si. And stores the result in si.
Definition at line 851 of file BoxSpecialist.cpp. References max, min, BoxSpecialist::SegmentInfo::pink, BoxSpecialist::SegmentInfo::skyblue, and BoxSpecialist::SegmentInfo::yellow. Referenced by createBBox(). |
|
A small test for goals.
Definition at line 190 of file BoxSpecialist.cpp. References segments_img. Referenced by fusionGoal(). |
|
Definition at line 989 of file BoxSpecialist.cpp. References point, sqr, Vector2< int >::x, and Vector2< int >::y. Referenced by fusionGoal(), and searchGoal(). |
|
Definition at line 1017 of file BoxSpecialist.cpp. References Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z. |
|
Creates the validity values for the different kinds of objects. The result is stored in info.
Definition at line 1052 of file BoxSpecialist.cpp. References BoxSpecialist::SegmentInfo::lmValiditySkyblue, BoxSpecialist::SegmentInfo::lmValidityYellow, BoxSpecialist::SegmentInfo::pink, BoxSpecialist::SegmentInfo::skyblue, and BoxSpecialist::SegmentInfo::yellow. Referenced by createBBox(). |
|
The strategy.
Definition at line 106 of file BoxSpecialist.h. Referenced by BoxSpecialist(), and invokeOnPreScan(). |
|
The edge detector.
Definition at line 108 of file BoxSpecialist.h. Referenced by BoxSpecialist(), executePostProcessing(), fitLandmark(), init(), invokeOnPreScan(), searchGoal(), and searchLandmark(). |
|
List of LinePairs. The input data of the detection algorithm. Definition at line 110 of file BoxSpecialist.h. Referenced by executePostProcessing(), init(), and invokeOnPreScan(). |
|
The calculated horizon.
Definition at line 112 of file BoxSpecialist.h. |
|
The calculated perpendicular to the horizon.
Definition at line 114 of file BoxSpecialist.h. Referenced by createBBox(), executePostProcessing(), fitLandmark(), mergeBoxes(), searchGoal(), and searchLandmark(). |
|
The threshold for edge-scans of the landmark detection.
Definition at line 116 of file BoxSpecialist.h. Referenced by BoxSpecialist(), and executePostProcessing(). |
|
The threshold for edge-scans of the goal detection.
Definition at line 118 of file BoxSpecialist.h. Referenced by BoxSpecialist(), and executePostProcessing(). |
|
A temporary variable.
Definition at line 120 of file BoxSpecialist.h. Referenced by invokeOnPreScan(). |
|
The clustered runs.
Definition at line 122 of file BoxSpecialist.h. Referenced by createBBox(), executePostProcessing(), init(), and missingData(). |
|
The calculated informations about the segments.
Definition at line 124 of file BoxSpecialist.h. Referenced by createBBox(), executePostProcessing(), fusionGoal(), and init(). |
|
The bottomPoints of the goal (edges from green to yellow or skyblue).
Definition at line 126 of file BoxSpecialist.h. Referenced by detectFreePartOfGoal(), init(), and invokeOnPostScan(). |