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

ColorTable32K Class Reference

Contains a ColorTable32K which can decode the color for every 16 * 4 * 4 cube in the 255 * 255 * 255 YUV color space. More...

#include <ColorTable32K.h>

Inheritance diagram for ColorTable32K:

Inheritance graph
[legend]
Collaboration diagram for ColorTable32K:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ColorTable32K ()
 Constructor.

 ~ColorTable32K ()
 Destructor.

colorClass getColorClassFast (const unsigned char y, const unsigned char u, const unsigned char v) const
 Calculates the color class of a pixel, it's fast because is non-virtual and inline, obviously can't be used through the common ColorTable interface.

virtual colorClass getColorClass (const unsigned char y, const unsigned char u, const unsigned char v) const
 Calculates the color class of a pixel.

void getBoxAroundColorClass (colorClass color, Vector3< int > &pNear, Vector3< int > &pFar)
 Computes an axis aligned box around all positions of a specified color in YUV space.

virtual void generateColorClassImage (const Image &image, ColorClassImage &colorClassImage) const
 Segments an image to a color class image.

virtual void generateColorClassImage (const Image &image, ColorClassImage &colorClassImage, colorClass colorClass) const
 Generates an image that contains all pixels that have the specified color class.

virtual void generateHighResColorClassImage (const Image &image, ColorClassImage &colorClassImage) const
 Segments an image to an color class image.

virtual void generateHighResColorClassImage (const Image &image, ColorClassImage &colorClassImage, colorClass colorClass) const
 Generates an image that contains all pixels that have the specified color class.

void unpack (unsigned char *unpackedCube, const unsigned char *packedCube)
 Unpacks the color table into a 64K array, used for performance testing (higher cache hit rate Vs less instructions per pixel).

Members to be used by the ColorTable32K dialog
void clear ()
 Resets the color table to noColor.

void clearChannel (colorClass colorClass)
 Sets all cubes that have the given color class to noColor.

void addColorClass (colorClass colorClass, unsigned char y, unsigned char u, unsigned char v)
 Sets the color class for a pixel in the color space given by y, u, v to the given color class.

void addColorClass (colorClass colorClass, unsigned char y, unsigned char u, unsigned char v, unsigned char range)
 Sets the color class for a cube with the size "range" around a pixel given by y,u,v to the given color class.

void addCuboidToColorClass (colorClass colorClass, unsigned char yMin, unsigned char uMin, unsigned char vMin, unsigned char yMax, unsigned char uMax, unsigned char vMax)
 Sets the color class for all sub cubes within the specified cuboid to the given color class.

void removeColorClass (unsigned char y, unsigned char u, unsigned char v, unsigned char range)
 Sets the color class for a cube with the size "range" around a pixel given by y,u,v to noColor.


Public Attributes

unsigned char colorClasses [8 *64 *64]
 The color table (array of 32K elements).

unsigned char colorClassesUnpacked [16 *64 *64]
 The unpacked color table (array of 64K elements), used for performance testing.


Detailed Description

Contains a ColorTable32K which can decode the color for every 16 * 4 * 4 cube in the 255 * 255 * 255 YUV color space.

The 64K elements color cube is packed into a 32KBytes color table (each element is just 4bits) accessed through fast shift and masking operations

Author:
Walter Nistico

Definition at line 27 of file ColorTable32K.h.


Constructor & Destructor Documentation

ColorTable32K::ColorTable32K  ) 
 

Constructor.

Definition at line 192 of file ColorTable32K.cpp.

References clear().

Here is the call graph for this function:

ColorTable32K::~ColorTable32K  ) 
 

Destructor.

Definition at line 188 of file ColorTable32K.cpp.


Member Function Documentation

colorClass ColorTable32K::getColorClassFast const unsigned char  y,
const unsigned char  u,
const unsigned char  v
const [inline]
 

Calculates the color class of a pixel, it's fast because is non-virtual and inline, obviously can't be used through the common ColorTable interface.

Parameters:
y the y value of the pixel
u the u value of the pixel
v the v value of the pixel
Returns:
the color class

Definition at line 44 of file ColorTable32K.h.

References colorClasses.

Referenced by generateColorClassImage(), generateHighResColorClassImage(), and getColorClass().

colorClass ColorTable32K::getColorClass const unsigned char  y,
const unsigned char  u,
const unsigned char  v
const [virtual]
 

Calculates the color class of a pixel.

Parameters:
y the y value of the pixel
u the u value of the pixel
v the v value of the pixel
Returns:
the color class

Reimplemented from ColorTable.

Definition at line 27 of file ColorTable32K.cpp.

References getColorClassFast().

Here is the call graph for this function:

void ColorTable32K::getBoxAroundColorClass colorClass  color,
Vector3< int > &  pNear,
Vector3< int > &  pFar
 

Computes an axis aligned box around all positions of a specified color in YUV space.

Parameters:
color The color
pNear The corner of the box nearest to the origin
pFar The corner of the box farthest to the origin

Definition at line 112 of file ColorTable32K.cpp.

References colorClassesUnpacked, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z.

void ColorTable32K::generateColorClassImage const Image image,
ColorClassImage colorClassImage
const [virtual]
 

Segments an image to a color class image.

This doesn't need to be used in the image processor, but is needed for visualisation of color tables.

Parameters:
image A reference to the image to be segmented
colorClassImage A reference to the color class image to be created

Reimplemented from ColorTable.

Definition at line 34 of file ColorTable32K.cpp.

References Image::cameraInfo, getColorClassFast(), ColorClassImage::height, Image::image, ColorClassImage::image, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and ColorClassImage::width.

Here is the call graph for this function:

void ColorTable32K::generateColorClassImage const Image image,
ColorClassImage colorClassImage,
colorClass  colorClass
const [virtual]
 

Generates an image that contains all pixels that have the specified color class.

Parameters:
image A reference to the image to be segmented
colorClassImage A reference to the color class image to be created
colorClass The color class.

Definition at line 48 of file ColorTable32K.cpp.

References Image::cameraInfo, getColorClassFast(), ColorClassImage::height, ColorClassImage::image, Image::image, noColor, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and ColorClassImage::width.

Here is the call graph for this function:

void ColorTable32K::generateHighResColorClassImage const Image image,
ColorClassImage colorClassImage
const [virtual]
 

Segments an image to an color class image.

This doesn't need to used in the image processor, but is needed for visualisation of color tables.

Parameters:
image A reference to the image to be segmented
colorClassImage A reference to the color class image to be created

Reimplemented from ColorTable.

Definition at line 70 of file ColorTable32K.cpp.

References Image::cameraInfo, getColorClassFast(), Image::getHighResY(), ColorClassImage::height, Image::image, ColorClassImage::image, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and ColorClassImage::width.

Here is the call graph for this function:

void ColorTable32K::generateHighResColorClassImage const Image image,
ColorClassImage colorClassImage,
colorClass  colorClass
const [virtual]
 

Generates an image that contains all pixels that have the specified color class.

Parameters:
image A reference to the image to be segmented
colorClassImage A reference to the color class image to be created
colorClass The color class.

Definition at line 87 of file ColorTable32K.cpp.

References Image::cameraInfo, getColorClassFast(), Image::getHighResY(), ColorClassImage::height, ColorClassImage::image, Image::image, noColor, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and ColorClassImage::width.

Here is the call graph for this function:

void ColorTable32K::unpack unsigned char *  unpackedCube,
const unsigned char *  packedCube
 

Unpacks the color table into a 64K array, used for performance testing (higher cache hit rate Vs less instructions per pixel).

Parameters:
unpackedCube Pointer to the unpacked buffer
packedCube Pointer to the packed buffer

Definition at line 11 of file ColorTable32K.cpp.

Referenced by operator>>().

void ColorTable32K::clear  )  [virtual]
 

Resets the color table to noColor.

Reimplemented from ColorTable.

Definition at line 340 of file ColorTable32K.cpp.

References colorClasses, and noColor.

Referenced by ColorTable32K().

void ColorTable32K::clearChannel colorClass  colorClass  )  [virtual]
 

Sets all cubes that have the given color class to noColor.

For that purpose, you should use AIBOVision.

Reimplemented from ColorTable.

Definition at line 326 of file ColorTable32K.cpp.

void ColorTable32K::addColorClass colorClass  colorClass,
unsigned char  y,
unsigned char  u,
unsigned char  v
 

Sets the color class for a pixel in the color space given by y, u, v to the given color class.

For that purpose, you should use AIBOVision.

Definition at line 202 of file ColorTable32K.cpp.

void ColorTable32K::addColorClass colorClass  colorClass,
unsigned char  y,
unsigned char  u,
unsigned char  v,
unsigned char  range
[virtual]
 

Sets the color class for a cube with the size "range" around a pixel given by y,u,v to the given color class.

For that purpose, you should use AIBOVision.

Reimplemented from ColorTable.

Definition at line 217 of file ColorTable32K.cpp.

void ColorTable32K::addCuboidToColorClass colorClass  colorClass,
unsigned char  yMin,
unsigned char  uMin,
unsigned char  vMin,
unsigned char  yMax,
unsigned char  uMax,
unsigned char  vMax
 

Sets the color class for all sub cubes within the specified cuboid to the given color class.

For that purpose, you should use AIBOVision.

Definition at line 257 of file ColorTable32K.cpp.

void ColorTable32K::removeColorClass unsigned char  y,
unsigned char  u,
unsigned char  v,
unsigned char  range
 

Sets the color class for a cube with the size "range" around a pixel given by y,u,v to noColor.

For that purpose, you should use AIBOVision.

Definition at line 290 of file ColorTable32K.cpp.


Member Data Documentation

unsigned char ColorTable32K::colorClasses[8*64*64]
 

The color table (array of 32K elements).

Each element in the array contains 2 points in the color space having same U,V and adjacent Y. Quantization is 16x4x4 (YUV)

Definition at line 138 of file ColorTable32K.h.

Referenced by clear(), getColorClassFast(), operator<<(), and operator>>().

unsigned char ColorTable32K::colorClassesUnpacked[16*64*64]
 

The unpacked color table (array of 64K elements), used for performance testing.

Definition at line 143 of file ColorTable32K.h.

Referenced by getBoxAroundColorClass(), and operator>>().


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