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

RDefaultStrategy Class Reference

Default-implementation of RasterStrategy. More...

#include <RDefaultStrategy.h>

Inheritance diagram for RDefaultStrategy:

Inheritance graph
[legend]
Collaboration diagram for RDefaultStrategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RDefaultStrategy (RasterImageProcessor &processor)
 The Constructor.

virtual ~RDefaultStrategy ()
 Destructor.

void execute ()
 Executes the strategy.

void init ()
 Initializes the strategy and its specialists.


Private Member Functions

void preScan ()
 Executes the pre-scan.

void postScan ()
 Executes the post-scan.

void postProcessing ()
 Executes the post-processing.

void checkBall (int x, int y, int prePost)
 Helper method for the scans.

void checkField (int x, int y, int prePost)
 Helper method for the scans.

void checkPlayer (int x, int y, int prePost)
 Helper method for the scans.

void checkBox (int x, int y, int prePost)
 Helper method for the scans.

void checkBridge (int x, int y)
 Helper method for the scans.

void checkRedLine (int x, int y)
 Helper method for the scans.


Private Attributes

RBallSpecialist2ballSpecialist
 A pointer to the ball specialist.

RFieldSpecialistfieldSpecialist
 A pointer to the field specialist (for Open Challenge 04).

REnemySpecialistenemySpecialist
 A pointer to the player specialist.

BoxSpecialistboxSpecialist
 A pointer to the box specialist (detects landmarks and goals).

RBridgeSpecialistbridgeSpecialist
 A pointer to the bridge specialist (for Open Challenge 04).

REdgeDetection edgeScanner
 The edge detector.

RFieldStateMachine fieldDSA
 The point state machine.

colorClass lastColor
 The color of the previous pixel.

colorClass currentColor
 The current color.

int width
 Width of the image.

int height
 Height of the image.

int ballFactor
 The subsampling factor for the ball.

int fieldFactor
 The subsampling factor for the field.

int goalFactor
 The subsampling factor for the goals.

int playerFactor
 The subsampling factor for the players.

int lmFactor
 The subsampling factor for the landmarks.

colorClass BoxColor
 A temporary variable.

colorClass bridgeColor
 A temporary variable.

bool active [7]
 Activation array for the several specialists.

int postThreshold
 Threshold for the edge detection of the post scan.


Detailed Description

Default-implementation of RasterStrategy.

Author:
Damien Deom

Hyung Won Koh

Manuel Neubach

Bernd Schmidt

Definition at line 33 of file RDefaultStrategy.h.


Constructor & Destructor Documentation

RDefaultStrategy::RDefaultStrategy RasterImageProcessor processor  ) 
 

The Constructor.

For creation the RasterImageProcessor is needed.

Parameters:
processor The image-processor.

Definition at line 14 of file RDefaultStrategy.cpp.

References boxSpecialist, bridgeSpecialist, enemySpecialist, InFile::exists(), fieldSpecialist, getLocation(), idText, RasterImageProcessor::marginX, RasterImageProcessor::marginY, OUTPUT, postThreshold, InStream< InFile, InBinary >::read(), RasterImageProcessor::setSpecialist(), and REdgeDetection::threshold.

Here is the call graph for this function:

RDefaultStrategy::~RDefaultStrategy  )  [virtual]
 

Destructor.

Definition at line 87 of file RDefaultStrategy.cpp.

References boxSpecialist, bridgeSpecialist, enemySpecialist, and fieldSpecialist.


Member Function Documentation

void RDefaultStrategy::execute  )  [virtual]
 

Executes the strategy.

Implements RasterStrategy.

Definition at line 132 of file RDefaultStrategy.cpp.

References postProcessing(), and preScan().

Here is the call graph for this function:

void RDefaultStrategy::init  )  [virtual]
 

Initializes the strategy and its specialists.

Implements RasterStrategy.

Definition at line 96 of file RDefaultStrategy.cpp.

References boxSpecialist, bridgeSpecialist, Image::cameraInfo, ImageProcessorInterfaces::cameraMatrix, enemySpecialist, fieldSpecialist, ImageProcessorInterfaces::image, RBridgeSpecialist::init(), REnemySpecialist::init(), BoxSpecialist::init(), RFieldSpecialist::init(), RBallSpecialist2::init(), CameraMatrix::isValid, RasterSpecialist::preScanNeeded, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.

Here is the call graph for this function:

void RDefaultStrategy::preScan  )  [private]
 

Executes the pre-scan.

Definition at line 142 of file RDefaultStrategy.cpp.

References Geometry::Line::base, BoxColor, boxSpecialist, bridgeColor, bridgeSpecialist, checkBall(), checkBox(), checkBridge(), checkPlayer(), checkRedLine(), currentColor, Geometry::Line::direction, enemySpecialist, fieldSpecialist, RasterStrategy::getColor(), RasterImageProcessor::horizon, RFieldSpecialist::invokeOnPreScan(), RBridgeSpecialist::invokeOnPreScan(), BoxSpecialist::invokeOnPreScan(), REnemySpecialist::invokeOnPreScan(), RBallSpecialist2::invokeOnPreScan(), lastColor, RasterImageProcessor::marginX, RasterImageProcessor::marginY, noColor, RasterSpecialist::preScanNeeded, Vector2< V >::rotateLeft(), Vector2< V >::x, Vector2< double >::x, Vector2< V >::y, and Vector2< double >::y.

Referenced by execute().

Here is the call graph for this function:

void RDefaultStrategy::postScan  )  [private]
 

Executes the post-scan.

Definition at line 320 of file RDefaultStrategy.cpp.

References RasterImageProcessor::addFieldPoint(), RasterImageProcessor::addObstaclePoints(), Geometry::Line::base, boxSpecialist, REdgeDetection::bufferedScan(), Image::cameraInfo, Geometry::clipLineWithRectangleCohenSutherland(), Geometry::Line::direction, DOT, RFieldStateMachine::farPoint(), fieldDSA, REdgeDetection::findStart(), RFieldStateMachine::foundObstacle(), RFieldStateMachine::getEdge(), Geometry::getIntersectionOfLines(), RFieldStateMachine::getObstacleType(), RFieldStateMachine::getType(), RasterImageProcessor::horizon, ImageProcessorInterfaces::image, BoxSpecialist::invokeOnPostScan(), RFieldStateMachine::nearPoint(), point, RFieldStateMachine::reset(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, REdgeDetection::setDirection(), RFieldStateMachine::size(), REdgeDetection::threshold, RFieldStateMachine::update(), Vector2< int >::x, Vector2< V >::x, Vector2< double >::x, Vector2< int >::y, Vector2< V >::y, and Vector2< double >::y.

Here is the call graph for this function:

void RDefaultStrategy::postProcessing  )  [private]
 

Executes the post-processing.

Definition at line 122 of file RDefaultStrategy.cpp.

References boxSpecialist, bridgeSpecialist, enemySpecialist, RFieldSpecialist::executePostProcessing(), RBridgeSpecialist::executePostProcessing(), BoxSpecialist::executePostProcessing(), REnemySpecialist::executePostProcessing(), RBallSpecialist2::executePostProcessing(), and fieldSpecialist.

Referenced by execute().

Here is the call graph for this function:

void RDefaultStrategy::checkBall int  x,
int  y,
int  prePost
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate
prePost pre or post scan

Definition at line 477 of file RDefaultStrategy.cpp.

References currentColor, RBallSpecialist2::invokeOnPreScan(), and RasterImageProcessor::marginX.

Referenced by preScan().

Here is the call graph for this function:

void RDefaultStrategy::checkField int  x,
int  y,
int  prePost
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate
prePost pre or post scan

Definition at line 491 of file RDefaultStrategy.cpp.

References currentColor, fieldFactor, fieldSpecialist, RFieldSpecialist::invokeOnPostScan(), and RFieldSpecialist::invokeOnPreScan().

Here is the call graph for this function:

void RDefaultStrategy::checkPlayer int  x,
int  y,
int  prePost
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate
prePost pre or post scan

Definition at line 460 of file RDefaultStrategy.cpp.

References currentColor, enemySpecialist, REnemySpecialist::invokeOnPreScan(), and RasterImageProcessor::marginX.

Referenced by preScan().

Here is the call graph for this function:

void RDefaultStrategy::checkBox int  x,
int  y,
int  prePost
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate
prePost pre or post scan

Definition at line 513 of file RDefaultStrategy.cpp.

References BoxColor, boxSpecialist, currentColor, BoxSpecialist::invokeOnPreScan(), RasterImageProcessor::marginX, and noColor.

Referenced by preScan().

Here is the call graph for this function:

void RDefaultStrategy::checkBridge int  x,
int  y
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate

Definition at line 553 of file RDefaultStrategy.cpp.

References bridgeColor, bridgeSpecialist, currentColor, RBridgeSpecialist::invokeOnPreScan(), RasterImageProcessor::marginX, and noColor.

Referenced by preScan().

Here is the call graph for this function:

void RDefaultStrategy::checkRedLine int  x,
int  y
[private]
 

Helper method for the scans.

Parameters:
x x-coordinate
y y-coordinate

Definition at line 538 of file RDefaultStrategy.cpp.

References currentColor, fieldSpecialist, and RFieldSpecialist::invokeOnPreScan().

Referenced by preScan().

Here is the call graph for this function:


Member Data Documentation

RBallSpecialist2* RDefaultStrategy::ballSpecialist [private]
 

A pointer to the ball specialist.

Definition at line 93 of file RDefaultStrategy.h.

RFieldSpecialist* RDefaultStrategy::fieldSpecialist [private]
 

A pointer to the field specialist (for Open Challenge 04).

Definition at line 95 of file RDefaultStrategy.h.

Referenced by checkField(), checkRedLine(), init(), postProcessing(), preScan(), RDefaultStrategy(), and ~RDefaultStrategy().

REnemySpecialist* RDefaultStrategy::enemySpecialist [private]
 

A pointer to the player specialist.

Definition at line 97 of file RDefaultStrategy.h.

Referenced by checkPlayer(), init(), postProcessing(), preScan(), RDefaultStrategy(), and ~RDefaultStrategy().

BoxSpecialist* RDefaultStrategy::boxSpecialist [private]
 

A pointer to the box specialist (detects landmarks and goals).

Definition at line 99 of file RDefaultStrategy.h.

Referenced by checkBox(), init(), postProcessing(), postScan(), preScan(), RDefaultStrategy(), and ~RDefaultStrategy().

RBridgeSpecialist* RDefaultStrategy::bridgeSpecialist [private]
 

A pointer to the bridge specialist (for Open Challenge 04).

Definition at line 101 of file RDefaultStrategy.h.

Referenced by checkBridge(), init(), postProcessing(), preScan(), RDefaultStrategy(), and ~RDefaultStrategy().

REdgeDetection RDefaultStrategy::edgeScanner [private]
 

The edge detector.

Definition at line 103 of file RDefaultStrategy.h.

RFieldStateMachine RDefaultStrategy::fieldDSA [private]
 

The point state machine.

Definition at line 105 of file RDefaultStrategy.h.

Referenced by postScan().

colorClass RDefaultStrategy::lastColor [private]
 

The color of the previous pixel.

Definition at line 107 of file RDefaultStrategy.h.

Referenced by preScan().

colorClass RDefaultStrategy::currentColor [private]
 

The current color.

Definition at line 109 of file RDefaultStrategy.h.

Referenced by checkBall(), checkBox(), checkBridge(), checkField(), checkPlayer(), checkRedLine(), and preScan().

int RDefaultStrategy::width [private]
 

Width of the image.

Definition at line 111 of file RDefaultStrategy.h.

int RDefaultStrategy::height [private]
 

Height of the image.

Definition at line 113 of file RDefaultStrategy.h.

int RDefaultStrategy::ballFactor [private]
 

The subsampling factor for the ball.

Definition at line 115 of file RDefaultStrategy.h.

int RDefaultStrategy::fieldFactor [private]
 

The subsampling factor for the field.

Definition at line 117 of file RDefaultStrategy.h.

Referenced by checkField().

int RDefaultStrategy::goalFactor [private]
 

The subsampling factor for the goals.

Definition at line 119 of file RDefaultStrategy.h.

int RDefaultStrategy::playerFactor [private]
 

The subsampling factor for the players.

Definition at line 121 of file RDefaultStrategy.h.

int RDefaultStrategy::lmFactor [private]
 

The subsampling factor for the landmarks.

Definition at line 123 of file RDefaultStrategy.h.

colorClass RDefaultStrategy::BoxColor [private]
 

A temporary variable.

Definition at line 125 of file RDefaultStrategy.h.

Referenced by checkBox(), and preScan().

colorClass RDefaultStrategy::bridgeColor [private]
 

A temporary variable.

Definition at line 127 of file RDefaultStrategy.h.

Referenced by checkBridge(), and preScan().

bool RDefaultStrategy::active[7] [private]
 

Activation array for the several specialists.

Definition at line 129 of file RDefaultStrategy.h.

int RDefaultStrategy::postThreshold [private]
 

Threshold for the edge detection of the post scan.

Definition at line 131 of file RDefaultStrategy.h.

Referenced by RDefaultStrategy().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:11:13 2004 for GT2004 by doxygen 1.3.6