#include <GT2004FlagSpecialist.h>
Public Member Functions | |
GT2004FlagSpecialist (const ColorCorrector &) | |
void | init (const Image &image) |
void | searchFlags (const Image &image, const ColorTable &colorTable, const CameraMatrix &cameraMatrix, colorClass color, bool pinkIsTop, const Geometry::Line horizonLine, int x, int y) |
void | getFlagPercept (const CameraMatrix &cameraMatrix, const CameraMatrix &prevCameraMatrix, const CameraInfo &cameraInfo, const Geometry::Line horizonLine, LandmarksPercept &landmarksPercept) |
DECLARE_DEBUG_IMAGE (imageProcessorFlags) | |
Private Types | |
maxNumberOfBoundingBoxes = 6 | |
numberOfHorizontalScans = 5 | |
numberOfVerticalScans = 3 | |
up | |
down | |
left | |
right | |
initial | |
vertical | |
horizontal | |
enum | { maxNumberOfBoundingBoxes = 6 } |
enum | { numberOfHorizontalScans = 5, numberOfVerticalScans = 3 } |
enum | Direction { up, down, left, right } |
enum | DebugType { initial, vertical, horizontal } |
Private Member Functions | |
void | estimateOffsetForFlags (LandmarksPercept &landmarksPercept, const Vector2< double > &cameraOffset) |
bool | findEndOfFlag (const Image &image, const CameraInfo &bwCameraInfo, const ColorTable &colorTable, const Vector2< int > start, Vector2< double > horizonDirection, Direction direction, Vector2< int > &destination, colorClass color, bool pinkIsTop, bool startIsInTop, DebugType type, int &countPixel, int &countTop, int &countBottom) |
Private Attributes | |
const ColorCorrector & | colorCorrector |
int | imageWidth |
int | imageHeight |
Vector2< int > | north |
Vector2< int > | east |
Vector2< int > | south |
Vector2< int > | west |
Vector2< int > | start |
Vector2< int > | destination |
double | boundingBoxTop [maxNumberOfBoundingBoxes][6] |
double | boundingBoxBottom [maxNumberOfBoundingBoxes][6] |
double | boundingBoxLeft [maxNumberOfBoundingBoxes][6] |
double | boundingBoxRight [maxNumberOfBoundingBoxes][6] |
bool | boundingBoxTopValid [maxNumberOfBoundingBoxes][6] |
bool | boundingBoxBottomValid [maxNumberOfBoundingBoxes][6] |
bool | boundingBoxLeftValid [maxNumberOfBoundingBoxes][6] |
bool | boundingBoxRightValid [maxNumberOfBoundingBoxes][6] |
int | numberOfBoundingBoxes [6] |
int | bestBoundingBox [6] |
Definition at line 22 of file GT2004FlagSpecialist.h.
anonymous enum [private] |
anonymous enum [private] |
Definition at line 68 of file GT2004FlagSpecialist.h.
enum GT2004FlagSpecialist::DebugType [private] |
enum GT2004FlagSpecialist::Direction [private] |
GT2004FlagSpecialist::GT2004FlagSpecialist | ( | const ColorCorrector & | ) |
Definition at line 16 of file GT2004FlagSpecialist.cpp.
GT2004FlagSpecialist::DECLARE_DEBUG_IMAGE | ( | imageProcessorFlags | ) |
Used for visualization of the flag scans
void GT2004FlagSpecialist::estimateOffsetForFlags | ( | LandmarksPercept & | landmarksPercept, | |
const Vector2< double > & | cameraOffset | |||
) | [private] |
Definition at line 567 of file GT2004FlagSpecialist.cpp.
References distance(), LandmarksPercept::flags, and LandmarksPercept::numberOfFlags.
Referenced by getFlagPercept().
bool GT2004FlagSpecialist::findEndOfFlag | ( | const Image & | image, | |
const CameraInfo & | bwCameraInfo, | |||
const ColorTable & | colorTable, | |||
const Vector2< int > | start, | |||
Vector2< double > | horizonDirection, | |||
Direction | direction, | |||
Vector2< int > & | destination, | |||
colorClass | color, | |||
bool | pinkIsTop, | |||
bool | startIsInTop, | |||
DebugType | type, | |||
int & | countPixel, | |||
int & | countTop, | |||
int & | countBottom | |||
) | [private] |
Definition at line 271 of file GT2004FlagSpecialist.cpp.
References CORRECTED_COLOR_CLASS, DEBUG_IMAGE_SET_PIXEL_RED, DEBUG_IMAGE_SET_PIXEL_Y, image, int(), pink, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.
void GT2004FlagSpecialist::getFlagPercept | ( | const CameraMatrix & | cameraMatrix, | |
const CameraMatrix & | prevCameraMatrix, | |||
const CameraInfo & | cameraInfo, | |||
const Geometry::Line | horizonLine, | |||
LandmarksPercept & | landmarksPercept | |||
) |
Definition at line 439 of file GT2004FlagSpecialist.cpp.
References LandmarksPercept::addFlag(), ConditionalBoundary::addX(), ConditionalBoundary::addY(), Geometry::Line::base, Player::blue, Geometry::Line::direction, estimateOffsetForFlags(), CameraInfo::focalLength, CameraInfo::focalLengthInv, getPlayer(), Player::getTeamColor(), CameraInfo::opticalCenter, Flag::pinkAboveSkyblue, Flag::pinkAboveYellow, Geometry::rayFromCamera(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, SEND_DEBUG_IMAGE, Flag::skyblueAbovePink, sqr, Pose3D::translation, Vector3< V >::x, Vector2< V >::x, Vector3< V >::y, Vector2< V >::y, and Flag::yellowAbovePink.
void GT2004FlagSpecialist::init | ( | const Image & | image | ) |
Initializes the flag specialist.
Definition at line 21 of file GT2004FlagSpecialist.cpp.
References image, INIT_DEBUG_IMAGE, and numberOfBoundingBoxes.
Referenced by GT2004BeaconDetector::execute().
void GT2004FlagSpecialist::searchFlags | ( | const Image & | image, | |
const ColorTable & | colorTable, | |||
const CameraMatrix & | cameraMatrix, | |||
colorClass | color, | |||
bool | pinkIsTop, | |||
const Geometry::Line | horizonLine, | |||
int | x, | |||
int | y | |||
) |
Searches for the flag in the image, starting from the specified point.
Definition at line 31 of file GT2004FlagSpecialist.cpp.
References Geometry::Line::base, Drawings::black, DEBUG_IMAGE_SET_PIXEL_BLUE, DEBUG_IMAGE_SET_PIXEL_GREEN, DEBUG_IMAGE_SET_PIXEL_RED, DEBUG_IMAGE_SET_PIXEL_YELLOW, Geometry::Line::direction, distance(), DOT, east, CameraInfo::focalLength, CameraInfo::focalLengthInv, Geometry::getDistanceToLine(), Drawings::green, image, int(), north, CameraInfo::opticalCenter, Flag::pinkAboveSkyblue, Flag::pinkAboveYellow, Drawings::red, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, skyblue, Flag::skyblueAbovePink, south, sqr, west, Vector2< V >::x, Vector2< V >::y, yellow, Drawings::yellow, and Flag::yellowAbovePink.
Referenced by GT2004BeaconDetector::analyzeBeacon(), and GT2004BeaconDetector::scanForBeaconEdges().
int GT2004FlagSpecialist::bestBoundingBox[6] [private] |
Definition at line 82 of file GT2004FlagSpecialist.h.
double GT2004FlagSpecialist::boundingBoxBottom[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 71 of file GT2004FlagSpecialist.h.
bool GT2004FlagSpecialist::boundingBoxBottomValid[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 76 of file GT2004FlagSpecialist.h.
double GT2004FlagSpecialist::boundingBoxLeft[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 72 of file GT2004FlagSpecialist.h.
bool GT2004FlagSpecialist::boundingBoxLeftValid[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 77 of file GT2004FlagSpecialist.h.
double GT2004FlagSpecialist::boundingBoxRight[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 73 of file GT2004FlagSpecialist.h.
bool GT2004FlagSpecialist::boundingBoxRightValid[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 78 of file GT2004FlagSpecialist.h.
double GT2004FlagSpecialist::boundingBoxTop[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 70 of file GT2004FlagSpecialist.h.
bool GT2004FlagSpecialist::boundingBoxTopValid[maxNumberOfBoundingBoxes][6] [private] |
Definition at line 75 of file GT2004FlagSpecialist.h.
const ColorCorrector& GT2004FlagSpecialist::colorCorrector [private] |
Definition at line 49 of file GT2004FlagSpecialist.h.
Vector2<int> GT2004FlagSpecialist::destination [private] |
Definition at line 60 of file GT2004FlagSpecialist.h.
Vector2<int> GT2004FlagSpecialist::east [private] |
Definition at line 56 of file GT2004FlagSpecialist.h.
int GT2004FlagSpecialist::imageHeight [private] |
Definition at line 52 of file GT2004FlagSpecialist.h.
int GT2004FlagSpecialist::imageWidth [private] |
Definition at line 51 of file GT2004FlagSpecialist.h.
Vector2<int> GT2004FlagSpecialist::north [private] |
Definition at line 55 of file GT2004FlagSpecialist.h.
int GT2004FlagSpecialist::numberOfBoundingBoxes[6] [private] |
Vector2<int> GT2004FlagSpecialist::south [private] |
Definition at line 57 of file GT2004FlagSpecialist.h.
Vector2<int> GT2004FlagSpecialist::start [private] |
Definition at line 59 of file GT2004FlagSpecialist.h.
Vector2<int> GT2004FlagSpecialist::west [private] |
Definition at line 58 of file GT2004FlagSpecialist.h.