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

RFieldSpecialist Class Reference

This class regognizes lines on the field, and the intersection of them. More...

#include <RFieldSpecialist.h>

Inheritance diagram for RFieldSpecialist:

Inheritance graph
[legend]
Collaboration diagram for RFieldSpecialist:

Collaboration graph
[legend]
List of all members.

Public Types

typedef slist< LinePair2lstLinePair
typedef slist< figurelstFig

Public Member Functions

 RFieldSpecialist (RasterImageProcessor &processor, RasterStrategy &strategy)
 The default constructor and destructor.

virtual ~RFieldSpecialist ()
virtual int getType ()
 Returns the id of the specialist.

virtual void init ()
 Clears the buffers of points.

void invokeOnPreScan (int x, int y)
 Function called by a given Strategy class Calling it one time stores the given coordinates in a temporar vector Calling it a second time creates an horizontal linepair and stores it in the linepair buffer.

void invokeOnPostScan (int x, int y)
 unused in this specialist

void addLinePoint (LinesPercept::LineType type, point &pt, int &id)
 Function called in the post scan section of the RDefaultStrategy when a line has been recognized.

void executePostProcessing ()
 Processing phase of the points.


Private Types

enum  goal_line { NONE = 0, YELLOW, SKYBLUE }
 id of the incoming goal line More...


Private Member Functions

int id (LinesPercept::LineType)
 id of the incoming line

LinesPercept::LineType id (int i)
bool makeLines (lstFig &inputList, lstLinePair &linePairList, const processParam *param)
 line recognition

void fusionLines (lstLinePair &lst)
 fusion spaced lines having the same angle value

unsigned int analyzeLines ()
 Computes the intersction of the lines and shows the result.

void checkRamp (lstLinePair &ramp)
 open challenge related function computes the angle of the ramp (must be a red line) and generate the corresponding line percept

void drawCross (goal_line g, point &v)
 debug related functions

void drawCircle (goal_line g, point &v)
void drawLine (goal_line g, LinePair2 &lp)

Private Attributes

RasterStrategystrategy
 a pointer to the strategy tha scan the image

REdgeDetection edgeScanner
 the scanner for adjusting the incoming point coordinates

processParamdefaultParam
 the default parameter set

lstFig lst_pts
 List of points stored during the horizontal scan.

point temp
 Temporar points.

LinesPercept::LineType lineInside
vector< lstLinePairvecLines
 The resulting lines.

vector< lstFigsegments_img
 The edges coming from the post scan method.


Detailed Description

This class regognizes lines on the field, and the intersection of them.

The most important points are shown: corners, goal points ...

Definition at line 30 of file RFieldSpecialist.h.


Member Typedef Documentation

typedef slist<LinePair2> RFieldSpecialist::lstLinePair
 

Definition at line 34 of file RFieldSpecialist.h.

Referenced by analyzeLines(), checkRamp(), executePostProcessing(), fusionLines(), and makeLines().

typedef slist<figure> RFieldSpecialist::lstFig
 

Definition at line 35 of file RFieldSpecialist.h.

Referenced by makeLines().


Member Enumeration Documentation

enum RFieldSpecialist::goal_line [private]
 

id of the incoming goal line

Enumeration values:
NONE  No line
YELLOW  Yellow goal line
SKYBLUE  Skyblue goal line

Definition at line 153 of file RFieldSpecialist.h.

Referenced by analyzeLines().


Constructor & Destructor Documentation

RFieldSpecialist::RFieldSpecialist RasterImageProcessor processor,
RasterStrategy strategy
 

The default constructor and destructor.

Definition at line 13 of file RFieldSpecialist.cpp.

References defaultParam, and lineInside.

RFieldSpecialist::~RFieldSpecialist  )  [virtual]
 

Definition at line 26 of file RFieldSpecialist.cpp.

References defaultParam.


Member Function Documentation

int RFieldSpecialist::getType  )  [virtual]
 

Returns the id of the specialist.

Implements RasterSpecialist.

Definition at line 31 of file RFieldSpecialist.cpp.

References __RFieldSpecialist.

void RFieldSpecialist::init  )  [virtual]
 

Clears the buffers of points.

See also:
lst_pts

segments_img

Implements RasterSpecialist.

Definition at line 36 of file RFieldSpecialist.cpp.

References slist< T >::clear().

Referenced by RDefaultStrategy::init().

Here is the call graph for this function:

void RFieldSpecialist::invokeOnPreScan int  x,
int  y
[virtual]
 

Function called by a given Strategy class Calling it one time stores the given coordinates in a temporar vector Calling it a second time creates an horizontal linepair and stores it in the linepair buffer.

See also:
lst_pts

Reimplemented from RasterSpecialist.

Definition at line 48 of file RFieldSpecialist.cpp.

References RasterStrategy::insideField, LINE, point, horLinePair::pt1(), horLinePair::pt2(), slist< T >::push_front(), REdgeDetection::scanEast(), REdgeDetection::scanWest(), REdgeDetection::threshold, Vector2< V >::x, and Vector2< V >::y.

Referenced by RDefaultStrategy::checkField(), RDefaultStrategy::checkRedLine(), and RDefaultStrategy::preScan().

Here is the call graph for this function:

void RFieldSpecialist::invokeOnPostScan int  x,
int  y
[virtual]
 

unused in this specialist

Reimplemented from RasterSpecialist.

Definition at line 94 of file RFieldSpecialist.cpp.

Referenced by RDefaultStrategy::checkField().

void RFieldSpecialist::addLinePoint LinesPercept::LineType  type,
point pt,
int &  id
 

Function called in the post scan section of the RDefaultStrategy when a line has been recognized.

Parameters:
type the type of the line
pt the first oint of the line
id the id of the scan line where the line has been found
The point is then stored in a vector of points
See also:
segments_img

Definition at line 97 of file RFieldSpecialist.cpp.

References id(), and point.

Here is the call graph for this function:

void RFieldSpecialist::executePostProcessing  )  [virtual]
 

Processing phase of the points.

See also:
lst_pts

segments_img

Reimplemented from RasterSpecialist.

Definition at line 242 of file RFieldSpecialist.cpp.

References checkRamp(), slist< T >::clear(), createLinearSegment(), defaultParam, slist< T >::front(), fusionLines(), slist< T >::getSize(), LINE, lstLinePair, and makeLines().

Referenced by RDefaultStrategy::postProcessing().

Here is the call graph for this function:

int RFieldSpecialist::id LinesPercept::LineType   )  [inline, private]
 

id of the incoming line

Definition at line 74 of file RFieldSpecialist.cpp.

Referenced by addLinePoint().

LinesPercept::LineType RFieldSpecialist::id int  i  )  [inline, private]
 

Definition at line 84 of file RFieldSpecialist.cpp.

bool RFieldSpecialist::makeLines lstFig inputList,
lstLinePair linePairList,
const processParam param
[private]
 

line recognition

Parameters:
inputList input list containing the points to analyse
linePairList the list of recognized lines
param the 3 parameters defined above
Returns:
a boolean that indicate if a line has been created

Definition at line 154 of file RFieldSpecialist.cpp.

References slist< T >::front(), slist< T >::getSize(), isEqual(), lstFig, lstLinePair, RFieldSpecialist::processParam::min_size, LinePair2::p2, point, slist< T >::push_front(), RFieldSpecialist::processParam::step_alpha, theta2(), and RFieldSpecialist::processParam::tol_alpha.

Referenced by executePostProcessing().

Here is the call graph for this function:

void RFieldSpecialist::fusionLines lstLinePair lst  )  [private]
 

fusion spaced lines having the same angle value

Definition at line 109 of file RFieldSpecialist.cpp.

References Geometry::distance(), slist< T >::erase(), slist< T >::front(), Geometry::getDistanceToLine(), lstLinePair, makeLine(), mil(), point, and theta2().

Referenced by executePostProcessing().

Here is the call graph for this function:

unsigned int RFieldSpecialist::analyzeLines  )  [private]
 

Computes the intersction of the lines and shows the result.

Definition at line 334 of file RFieldSpecialist.cpp.

References drawCircle(), drawCross(), drawLine(), slist< T >::front(), Geometry::getIntersectionOfLines(), LinePair2::getLength(), goal_line, idText, LINE, lstLinePair, makeLine(), NONE, NONE, OUTPUT, LinePair2::p1, LinePair2::p2, point, SKYBLUE, theta2(), vecLines, Vector2< V >::x, Vector2< V >::y, and YELLOW.

Here is the call graph for this function:

void RFieldSpecialist::checkRamp lstLinePair ramp  )  [private]
 

open challenge related function computes the angle of the ramp (must be a red line) and generate the corresponding line percept

Definition at line 441 of file RFieldSpecialist.cpp.

References OCRedLine::addPercept(), Geometry::calculatePointOnField(), Image::cameraInfo, ImageProcessorInterfaces::cameraMatrix, slist< T >::front(), idText, ImageProcessorInterfaces::image, LINE, lstLinePair, RasterImageProcessor::maxX, SpecialPercept::ocRedLine, OUTPUT, LinePair2::p1, LinePair2::p2, point, ImageProcessorInterfaces::specialPercept, theta2(), Vector2< V >::x, and Vector2< V >::y.

Referenced by executePostProcessing().

Here is the call graph for this function:

void RFieldSpecialist::drawCross goal_line  g,
point v
[private]
 

debug related functions

Definition at line 273 of file RFieldSpecialist.cpp.

References LINE, point, SKYBLUE, Vector2< V >::x, Vector2< V >::y, and YELLOW.

Referenced by analyzeLines().

void RFieldSpecialist::drawCircle goal_line  g,
point v
[private]
 

Definition at line 302 of file RFieldSpecialist.cpp.

References CIRCLE, point, SKYBLUE, Vector2< V >::x, Vector2< V >::y, and YELLOW.

Referenced by analyzeLines().

void RFieldSpecialist::drawLine goal_line  g,
LinePair2 lp
[private]
 

Definition at line 318 of file RFieldSpecialist.cpp.

References LINE, LinePair2::p1, LinePair2::p2, SKYBLUE, Vector2< V >::x, Vector2< V >::y, and YELLOW.

Referenced by analyzeLines().


Member Data Documentation

RasterStrategy* RFieldSpecialist::strategy [private]
 

a pointer to the strategy tha scan the image

Definition at line 85 of file RFieldSpecialist.h.

REdgeDetection RFieldSpecialist::edgeScanner [private]
 

the scanner for adjusting the incoming point coordinates

Definition at line 88 of file RFieldSpecialist.h.

processParam* RFieldSpecialist::defaultParam [private]
 

the default parameter set

Definition at line 106 of file RFieldSpecialist.h.

Referenced by executePostProcessing(), RFieldSpecialist(), and ~RFieldSpecialist().

lstFig RFieldSpecialist::lst_pts [private]
 

List of points stored during the horizontal scan.

Definition at line 111 of file RFieldSpecialist.h.

point RFieldSpecialist::temp [private]
 

Temporar points.

Definition at line 116 of file RFieldSpecialist.h.

LinesPercept::LineType RFieldSpecialist::lineInside [private]
 

Definition at line 117 of file RFieldSpecialist.h.

Referenced by RFieldSpecialist().

vector<lstLinePair> RFieldSpecialist::vecLines [private]
 

The resulting lines.

Definition at line 137 of file RFieldSpecialist.h.

Referenced by analyzeLines().

vector<lstFig> RFieldSpecialist::segments_img [private]
 

The edges coming from the post scan method.

See also:
RDefaulstrategy2

Definition at line 143 of file RFieldSpecialist.h.


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