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

ColorCorrector Class Reference

The class represents a table for color correction. More...

#include <ColorCorrector.h>

List of all members.

Public Member Functions

 ColorCorrector ()
 Default constructor.

unsigned char correct (const int x, const int y, const int c, const unsigned char intensity) const
 The functions returns a corrected intensity of a pixel.

void correct (const int x, const int y, unsigned char &intensityY, unsigned char &intensityU, unsigned char &intensityV) const
 The functions returns the corrected color of a pixel.

void correct (Image &image) const
 The functions corrects all pixels of an image.


Private Types

enum  { maxRadius = 140, centerRadius = 10 }
enum  { maxRadialOrder = 10, maxColorOrder = 10 }

Private Member Functions

void load ()
 Loads the calibration image and computes the lookup table.

void disable ()
 The function disables the color correction.


Static Private Member Functions

unsigned char colorDistortionCorrection (const unsigned char radius_i, const unsigned char color, const unsigned char channel)
unsigned char calcRadius (int x, int y)
 The function calculates the corresponding radius for an image coordinate.


Private Attributes

unsigned char radiusTable [cameraResolutionHeight_ERS7][cameraResolutionWidth_ERS7]
 The radius table.


Static Private Attributes

unsigned char correctionTable [maxRadius+1][256][3]
 The correction table.

int radialOrder = 0
int colorOrder = 0
double radialP [3 *maxRadialOrder]
double colorP [3 *maxColorOrder]
bool loaded = false
 Determines whether the corrector has already been loaded.


Detailed Description

The class represents a table for color correction.

Definition at line 25 of file ColorCorrector.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
maxRadius 
centerRadius 

Definition at line 28 of file ColorCorrector.h.

anonymous enum [private]
 

Enumeration values:
maxRadialOrder 
maxColorOrder 

Definition at line 33 of file ColorCorrector.h.


Constructor & Destructor Documentation

ColorCorrector::ColorCorrector  )  [inline]
 

Default constructor.

Definition at line 67 of file ColorCorrector.h.

References load().

Here is the call graph for this function:


Member Function Documentation

unsigned char ColorCorrector::colorDistortionCorrection const unsigned char  radius_i,
const unsigned char  color,
const unsigned char  channel
[static, private]
 

Definition at line 210 of file ColorCorrector.cpp.

References colorOrder, colorP, maxColorOrder, maxRadialOrder, radialOrder, and radialP.

unsigned char ColorCorrector::calcRadius int  x,
int  y
[inline, static, private]
 

The function calculates the corresponding radius for an image coordinate.

Parameters:
x The x coordinate of a pixel.
y The y coordinate of a pixel.
Returns:
The distance from the center of the image.

Definition at line 54 of file ColorCorrector.h.

References cameraResolutionHeight_ERS7, cameraResolutionWidth_ERS7, and centerRadius.

Referenced by load().

unsigned char ColorCorrector::correct const int  x,
const int  y,
const int  c,
const unsigned char  intensity
const [inline]
 

The functions returns a corrected intensity of a pixel.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
c The color channel corrected.
intensity The intensity of the pixel in color channel c.
Returns:
The corrected intensity.

Definition at line 77 of file ColorCorrector.h.

References correctionTable.

Referenced by correct(), VLCGoalRecognizer::detectEdge(), GT2005GoalRecognizer::detectEdge(), VLCLineFinder_DeterministicApproach::doVerificationScan(), SlamBorderFinder::doVerificationScan(), GT2005LineFinder_DeterministicApproach::doVerificationScan(), VLCLineFinder_DeterministicApproach::doVerificationScanForCircle(), GT2005LineFinder_DeterministicApproach::doVerificationScanForCircle(), SlamImageProcessor::execute(), VLCBallSpecialist::findEndOfBall(), GT2005BallSpecialist::findEndOfBall(), SlamBeaconDetector::findSpecial(), VLCRobotSpecialist::generateColorspace(), GT2005RobotSpecialist::generateColorspace(), VLCRobotSpecialist::generatePercept(), GT2005RobotSpecialist::generatePercept(), VLCRobotSpecialist::noColorPixelsBetween(), GT2005RobotSpecialist::noColorPixelsBetween(), VLCRobotSpecialist::scan(), VLCImageProcessor::scan(), SlamImageProcessor::scan(), GT2005RobotSpecialist::scan(), GT2005ImageProcessor::scan(), GT2005CenterCircleFinder::scan(), VLCGoalRecognizer::scanAlongLine(), GT2005GoalRecognizer::scanAlongLine(), VLCBeaconDetector::scanForBeaconEdges(), SlamBeaconDetector::scanForBeaconEdges(), GT2005BeaconDetector::scanForBeaconEdges(), VLCBeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForBeaconPart(), GT2005BeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForFlagCharacterization(), VLCBeaconDetector::scanForPink(), SlamBeaconDetector::scanForPink(), and GT2005BeaconDetector::scanForPink().

void ColorCorrector::correct const int  x,
const int  y,
unsigned char &  intensityY,
unsigned char &  intensityU,
unsigned char &  intensityV
const [inline]
 

The functions returns the corrected color of a pixel.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
intensityY The intensity of the pixel in color channel Y.
intensityU The intensity of the pixel in color channel U.
intensityV The intensity of the pixel in color channel V.

Definition at line 95 of file ColorCorrector.h.

References correctionTable.

void ColorCorrector::correct Image image  )  const
 

The functions corrects all pixels of an image.

Parameters:
image The image that is corrected.

Definition at line 251 of file ColorCorrector.cpp.

References Image::cameraInfo, correct(), Image::image, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.

Here is the call graph for this function:

void ColorCorrector::load  )  [private]
 

Loads the calibration image and computes the lookup table.

Definition at line 35 of file ColorCorrector.cpp.

References calcRadius(), Image::cameraInfo, cameraResolutionHeight_ERS7, cameraResolutionWidth_ERS7, correctionTable, disable(), InStream< InFile, InBinary >::eof(), InFile::exists(), Image::frameNumber, getLocation(), getRobotConfiguration(), RobotConfiguration::getRobotDesign(), Image::image, loaded, maxRadius, InStream< InFile, InBinary >::read(), CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.

Referenced by ColorCorrector().

Here is the call graph for this function:

void ColorCorrector::disable  )  [private]
 

The function disables the color correction.

The table is cleared.

Definition at line 244 of file ColorCorrector.cpp.

References cameraResolutionHeight_ERS7, cameraResolutionWidth_ERS7, and maxRadius.

Referenced by load().


Member Data Documentation

unsigned char ColorCorrector::radiusTable[cameraResolutionHeight_ERS7][cameraResolutionWidth_ERS7] [private]
 

The radius table.

Per (simulated) robot.

Definition at line 29 of file ColorCorrector.h.

unsigned char ColorCorrector::correctionTable [static, private]
 

The correction table.

Definition at line 19 of file ColorCorrector.cpp.

Referenced by correct(), and load().

int ColorCorrector::radialOrder = 0 [static, private]
 

Definition at line 22 of file ColorCorrector.cpp.

Referenced by colorDistortionCorrection().

int ColorCorrector::colorOrder = 0 [static, private]
 

Definition at line 23 of file ColorCorrector.cpp.

Referenced by colorDistortionCorrection().

double ColorCorrector::radialP [static, private]
 

Definition at line 24 of file ColorCorrector.cpp.

Referenced by colorDistortionCorrection().

double ColorCorrector::colorP [static, private]
 

Definition at line 25 of file ColorCorrector.cpp.

Referenced by colorDistortionCorrection().

bool ColorCorrector::loaded = false [static, private]
 

Determines whether the corrector has already been loaded.

Definition at line 18 of file ColorCorrector.cpp.

Referenced by load().


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:11:42 2006 for GT2005 by doxygen 1.3.6