CheckerboardDetector Class Reference

#include <CheckerboardDetector.h>

Inheritance diagram for CheckerboardDetector:

ImageProcessor Module ImageProcessorInterfaces MessageHandler List of all members.

Public Member Functions

 CheckerboardDetector (const ImageProcessorInterfaces &interfaces)
virtual void execute ()

Private Types

typedef Vector2< double > v2dArray [100]
typedef bool bArray [100]

Private Member Functions

 DECLARE_DEBUG_IMAGE (imageProcessorGeneral)
double getAngleBetweenScreenPoints (const Vector2< double > &p1, const Vector2< double > &p2)
Vector2< double > getExactTransitionMiddle (const Geometry::PixeledLine lin, const int start, const int amount)
void getTransitionsOnLine (const Geometry::PixeledLine lin, v2dArray *transPos, bArray *transWhiteBlack, int &numOfTrans)
Vector2< double > getTransitionToWhite (const Geometry::PixeledLine lin)
Vector2< double > getMiddleAndLengthOfPerpendicular (const Vector2< double > t1, const Vector2< double > t2, double &len)
bool getLineThroughPixelsCandidate (const v2dArray *points, const int numOfPoints, double &m, double &n)
bool getLineThroughPixels (const v2dArray *points, const int numOfPoints, Geometry::PixeledLine &lin)
Vector2< double > getPositionFromAngles (const double alpha2, const double a2, const double alpha1, const double a1)
double yPosFromTransitionIndex (int index)

Private Attributes

int minY
int maxY
int maxDelta

Detailed Description

A solution of the ImageProcessor module that looks for vertical checkerboards (a row of black and white ~10x10cm tiles with a white boarder and a middle mark in eye height that allows precise location of the robot relative to the checkerboard from a single image

Author:
Uwe Düffert

Definition at line 28 of file CheckerboardDetector.h.


Member Typedef Documentation

typedef bool CheckerboardDetector::bArray[100] [private]

Definition at line 45 of file CheckerboardDetector.h.

typedef Vector2<double> CheckerboardDetector::v2dArray[100] [private]

Definition at line 44 of file CheckerboardDetector.h.


Constructor & Destructor Documentation

CheckerboardDetector::CheckerboardDetector ( const ImageProcessorInterfaces interfaces  ) 

Constructor.

Parameters:
interfaces The paramters of the ImageProcessor module.

Definition at line 12 of file CheckerboardDetector.cpp.


Member Function Documentation

CheckerboardDetector::DECLARE_DEBUG_IMAGE ( imageProcessorGeneral   )  [private]

void CheckerboardDetector::execute (  )  [virtual]

Executes the module

Implements Module.

Definition at line 335 of file CheckerboardDetector.cpp.

References Image::cameraInfo, DEBUG_IMAGE_SET_PIXEL_YELLOW, RobotDimensions::distancePanCenterToCameraX, Image::frameNumber, getMiddleAndLengthOfPerpendicular(), getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), getTransitionsOnLine(), Image::image, ImageProcessorInterfaces::image, INIT_DEBUG_IMAGE, maxDelta, maxY, minY, SpecialPercept::reset(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, ImageProcessorInterfaces::specialPercept, Vector2< V >::x, and Vector2< V >::y.

double CheckerboardDetector::getAngleBetweenScreenPoints ( const Vector2< double > &  p1,
const Vector2< double > &  p2 
) [private]

calculates the exact middle of an black white transition in a PixeledLine.

Parameters:
p1 one point in camera coordinates
p2 another point in camera coordinates
Returns:
the resulting arc difference between these 2 points

Definition at line 277 of file CheckerboardDetector.cpp.

References Image::cameraInfo, ImageProcessorInterfaces::image, CameraInfo::openingAngleHeight, CameraInfo::openingAngleWidth, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Vector2< double > CheckerboardDetector::getExactTransitionMiddle ( const Geometry::PixeledLine  lin,
const int  start,
const int  amount 
) [private]

calculates the exact middle of an black white transition in a PixeledLine.

Parameters:
lin the PixeledLine to investigate
start index of black white transition in lin to investigate
amount the total change of brightness in this black white transition
Returns:
the resulting position of the middle of the black white transition

Definition at line 17 of file CheckerboardDetector.cpp.

References abs(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Image::image, ImageProcessorInterfaces::image, Vector2< V >::x, and Vector2< V >::y.

Referenced by getTransitionsOnLine(), and getTransitionToWhite().

bool CheckerboardDetector::getLineThroughPixels ( const v2dArray points,
const int  numOfPoints,
Geometry::PixeledLine lin 
) [private]

approximates a PixeledLine through a number of points without found elopers

Parameters:
points an array of points that should be approximated by a line
numOfPoints number of points in the array
lin the returned PixeledLine
Returns:
true if a line was found

Definition at line 207 of file CheckerboardDetector.cpp.

References Image::cameraInfo, Geometry::clipLineWithRectangleCohenSutherland(), getLineThroughPixelsCandidate(), ImageProcessorInterfaces::image, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.

bool CheckerboardDetector::getLineThroughPixelsCandidate ( const v2dArray points,
const int  numOfPoints,
double &  m,
double &  n 
) [private]

approximates a line f(x)=m*x+n through a number of points

Parameters:
points an array of points that should be approximated by a line
numOfPoints number of points in the array
m the returned Anstieg of the line (f(x)=mx+n)
n the returned offset of the line (f(x)=mx+n)
Returns:
true if a line (candidate) was found

Definition at line 178 of file CheckerboardDetector.cpp.

Referenced by getLineThroughPixels().

Vector2< double > CheckerboardDetector::getMiddleAndLengthOfPerpendicular ( const Vector2< double >  t1,
const Vector2< double >  t2,
double &  len 
) [private]

calculate a middle perpendicular to t1-t2, find transitions to white on that perpendicular and return the middle between the transitions to white. This gives a better and more secure black block middle than the the middle between t1 and t2 itself.

Parameters:
t1 beginning of black block
t2 end of black block
len returned length of the found perpendicular in black, 0 otherwise
Returns:
the position of of found middle of the perpendicular (if it exists), (-1,-1) otherwise

Definition at line 148 of file CheckerboardDetector.cpp.

References Image::cameraInfo, Geometry::clipLineWithRectangleCohenSutherland(), getTransitionToWhite(), ImageProcessorInterfaces::image, pi_2, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

Vector2< double > CheckerboardDetector::getPositionFromAngles ( const double  alpha2,
const double  a2,
const double  alpha1,
const double  a1 
) [private]

calculate a position relative to the checkerboard

Parameters:
alpha2 absolute angle between the left most and the middle seen black white transition
a2 absolute distance on the checkboard between the left most and the middle seen black white transition
alpha1 absolute angle between the middle and the right most seen black white transition
a1 absolute distance on the checkboard between the middle and the right most seen black white transition
Returns:
returned position relative to seen middle transition in checkerboard

Definition at line 249 of file CheckerboardDetector.cpp.

References b, pi, Vector2< V >::x, and Vector2< V >::y.

void CheckerboardDetector::getTransitionsOnLine ( const Geometry::PixeledLine  lin,
v2dArray transPos,
bArray transWhiteBlack,
int &  numOfTrans 
) [private]

finds all black white transitions in a PixeledLine

Parameters:
lin the PixeledLine to investigate
transPos returned array of found transition middle positions
transWhiteBlack returned array of booleans whether transition is from white to black or vice versa
numOfTrans returned number of found transitions

Definition at line 36 of file CheckerboardDetector.cpp.

References abs(), DEBUG_IMAGE_SET_PIXEL_BLUE, DEBUG_IMAGE_SET_PIXEL_RED, getExactTransitionMiddle(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Image::image, ImageProcessorInterfaces::image, maxDelta, Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

Vector2< double > CheckerboardDetector::getTransitionToWhite ( const Geometry::PixeledLine  lin  )  [private]

finds the first transition to white starting from within a black block

Parameters:
lin the PixeledLine to investigate
Returns:
the position of the found transition to white, (-1,-1) otherwise

Definition at line 107 of file CheckerboardDetector.cpp.

References getExactTransitionMiddle(), Geometry::PixeledLine::getNumberOfPixels(), Geometry::PixeledLine::getPixelX(), Geometry::PixeledLine::getPixelY(), Image::image, ImageProcessorInterfaces::image, maxDelta, maxY, and minY.

Referenced by getMiddleAndLengthOfPerpendicular().

double CheckerboardDetector::yPosFromTransitionIndex ( int  index  )  [private]

calculate the real y position of a black white transition on the checkerboard

Parameters:
index index of the black white transition relative to the left side (0) of the large black middle block, left is negative, right positive
Returns:
real y position

Definition at line 330 of file CheckerboardDetector.cpp.


Member Data Documentation

int CheckerboardDetector::maxDelta [private]

Definition at line 43 of file CheckerboardDetector.h.

Referenced by execute(), getTransitionsOnLine(), and getTransitionToWhite().

int CheckerboardDetector::maxY [private]

Definition at line 43 of file CheckerboardDetector.h.

Referenced by execute(), and getTransitionToWhite().

int CheckerboardDetector::minY [private]

Definition at line 43 of file CheckerboardDetector.h.

Referenced by execute(), and getTransitionToWhite().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:21:22 2006 for DT2005.panorama by  doxygen 1.4.7