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

ColorTable64 Class Reference

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

#include <ColorTable64.h>

Inheritance diagram for ColorTable64:

Inheritance graph
[legend]
Collaboration diagram for ColorTable64:

Collaboration graph
[legend]
List of all members.

Members to be used by the ColorTable64 dialog

enum  { CT32K_SIZE = 8*64*64, CT64_SIZE = 64*64*64 }
void clear ()
 Sets the color class of every 4x4x4 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.

void setFormat (Format form)
Inoperator>> (In &stream, ColorTable64 &colorTable64)
 Streaming operator that reads a ColorTable64 from a stream.


Public Types

enum  Format { CT32K, CT64 }

Public Member Functions

 ColorTable64 ()
 Constructor.

 ~ColorTable64 ()
 Destructor.

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 an 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 shrink ()
 This function marks the outer pixels of all segmented colors in the colorspace as noColor.

void shrink (unsigned char color)
 This function marks the outer pixels of the parameter color in the colorspace as noColor.

void grow ()
 This function marks all noColor pixels in the colorspace, which are neighbors of segmented pixels, with the neighboring color.

void grow (unsigned char color)
 This function marks all noColor pixels in the colorspace, which are neighbors of the parameter color, with the neighboring color.


Public Attributes

unsigned char colorClasses [64][64][64]
 The color table.


Private Member Functions

bool hasXNeighbors (unsigned char y, unsigned char u, unsigned char v, int x, unsigned char colorClassesArray[64][64][64])
 Returns true if the pixel y,u,v in the colorClassesArray has more than x or x neighbors.

unsigned char getNeighborColor (unsigned char y, unsigned char u, unsigned char v, unsigned char colorClassesArray[64][64][64])
 Returns the color of one of the neighboring pixels of the pixel y,u,v.


Static Private Member Functions

void convert32Kto64 (const unsigned char *c32k, unsigned char c64[64][64][64])

Private Attributes

Format format

Detailed Description

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

Author:
Matthias Jüngel

Martin Lötzsch

Definition at line 30 of file ColorTable64.h.


Member Enumeration Documentation

enum ColorTable64::Format
 

Enumeration values:
CT32K 
CT64 

Definition at line 39 of file ColorTable64.h.

anonymous enum
 

Enumeration values:
CT32K_SIZE 
CT64_SIZE 

Definition at line 177 of file ColorTable64.h.


Constructor & Destructor Documentation

ColorTable64::ColorTable64  ) 
 

Constructor.

Definition at line 106 of file ColorTable64.cpp.

References clear().

Here is the call graph for this function:

ColorTable64::~ColorTable64  ) 
 

Destructor.

Definition at line 111 of file ColorTable64.cpp.


Member Function Documentation

virtual colorClass ColorTable64::getColorClass const unsigned char  y,
const unsigned char  u,
const unsigned char  v
const [inline, 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 48 of file ColorTable64.h.

void ColorTable64::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 242 of file ColorTable64.cpp.

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

void ColorTable64::generateColorClassImage 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 11 of file ColorTable64.cpp.

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

void ColorTable64::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 57 of file ColorTable64.cpp.

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

void ColorTable64::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 40 of file ColorTable64.cpp.

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

Here is the call graph for this function:

void ColorTable64::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 79 of file ColorTable64.cpp.

References Image::cameraInfo, 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 ColorTable64::clear  )  [virtual]
 

Sets the color class of every 4x4x4 to noColor.

Reimplemented from ColorTable.

Definition at line 228 of file ColorTable64.cpp.

References noColor.

Referenced by ColorTable64().

void ColorTable64::clearChannel colorClass  colorClass  )  [virtual]
 

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

Reimplemented from ColorTable.

Definition at line 214 of file ColorTable64.cpp.

References noColor.

void ColorTable64::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.

Definition at line 114 of file ColorTable64.cpp.

void ColorTable64::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.

Reimplemented from ColorTable.

Definition at line 125 of file ColorTable64.cpp.

References ASSERT.

void ColorTable64::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.

Definition at line 157 of file ColorTable64.cpp.

References ASSERT.

void ColorTable64::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.

Definition at line 186 of file ColorTable64.cpp.

References noColor.

void ColorTable64::setFormat Format  form  )  [inline]
 

Definition at line 172 of file ColorTable64.h.

References format.

Referenced by ColorTable64Mod::setup(), ColorTable32KMod::setup(), and VLCImageProcessor::VLCImageProcessor().

void ColorTable64::shrink  )  [virtual]
 

This function marks the outer pixels of all segmented colors in the colorspace as noColor.

Reimplemented from ColorTable.

Definition at line 573 of file ColorTable64.cpp.

References hasXNeighbors(), and noColor.

Here is the call graph for this function:

void ColorTable64::shrink unsigned char  color  )  [virtual]
 

This function marks the outer pixels of the parameter color in the colorspace as noColor.

&param color The color to shrink

Reimplemented from ColorTable.

Definition at line 593 of file ColorTable64.cpp.

References hasXNeighbors(), and noColor.

Here is the call graph for this function:

void ColorTable64::grow  )  [virtual]
 

This function marks all noColor pixels in the colorspace, which are neighbors of segmented pixels, with the neighboring color.

Reimplemented from ColorTable.

Definition at line 613 of file ColorTable64.cpp.

References getNeighborColor(), and hasXNeighbors().

Here is the call graph for this function:

void ColorTable64::grow unsigned char  color  )  [virtual]
 

This function marks all noColor pixels in the colorspace, which are neighbors of the parameter color, with the neighboring color.

Reimplemented from ColorTable.

Definition at line 633 of file ColorTable64.cpp.

References getNeighborColor(), and hasXNeighbors().

Here is the call graph for this function:

void ColorTable64::convert32Kto64 const unsigned char *  c32k,
unsigned char  c64[64][64][64]
[static, private]
 

Definition at line 25 of file ColorTable64.cpp.

Referenced by operator>>().

bool ColorTable64::hasXNeighbors unsigned char  y,
unsigned char  u,
unsigned char  v,
int  x,
unsigned char  colorClassesArray[64][64][64]
[private]
 

Returns true if the pixel y,u,v in the colorClassesArray has more than x or x neighbors.

Parameters:
y the y coordinate of the pixel in the colorspace
u the u coordinate of the pixel in the colorspace
v the v coordinate of the pixel in the colorspace
x the number of desired pixels
colorClassesArray the Array with the colorClasses

Definition at line 462 of file ColorTable64.cpp.

Referenced by grow(), and shrink().

unsigned char ColorTable64::getNeighborColor unsigned char  y,
unsigned char  u,
unsigned char  v,
unsigned char  colorClassesArray[64][64][64]
[private]
 

Returns the color of one of the neighboring pixels of the pixel y,u,v.

If no direct neighbor is present, noColor s returned.

Parameters:
y the y coordinate of the pixel in the colorspace
u the u coordinate of the pixel in the colorspace
v the v coordinate of the pixel in the colorspace
colorClassesArray the Array with the colorClasses

Definition at line 518 of file ColorTable64.cpp.

References noColor.

Referenced by grow().


Friends And Related Function Documentation

In& operator>> In stream,
ColorTable64 colorTable64
[friend]
 

Streaming operator that reads a ColorTable64 from a stream.

Parameters:
stream The stream from which is read.
colorTable64 The ColorTable64 object.
Returns:
The stream.

Definition at line 404 of file ColorTable64.cpp.


Member Data Documentation

unsigned char ColorTable64::colorClasses[64][64][64]
 

The color table.

Each element in the array contains the color class of a 4x4x4 cube in the color space.

Definition at line 114 of file ColorTable64.h.

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

Format ColorTable64::format [private]
 

Definition at line 213 of file ColorTable64.h.

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


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