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

# Modules/ImageProcessor/ImageProcessorTools/ColorTableCuboids.h

Go to the documentation of this file.

    00001 /**
    00002 * @file ColorTableCuboids.h
    00003 * Declaration of class ColorTableCuboids.
    00004 *
    00005 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00006 */
    00007
    00008 #ifndef _ColorTableCuboids_h_
    00009 #define _ColorTableCuboids_h_
    00010
    00011 #include "Representations/Perception/Image.h"
    00012 #include "Tools/ColorClasses.h"
    00013
    00014 /**
    00015 * @class ColorTableCuboids
    00016 *
    00017 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00018 */
    00019 class ColorTableCuboids : public ColorTable
    00020 {
    00021 public:
    00022   /** Constructor */
    00023   ColorTableCuboids();
    00024
    00025   /** Destructor */
    00026   ~ColorTableCuboids();
    00027
    00028   /**
    00029   * Calculates the color classes of a point in the yuv color space.
    00030   * @param y the y value of the pixel
    00031   * @param u the u value of the pixel
    00032   * @param v the v value of the pixel
    00033   */
    00034   virtual colorClass getColorClass (
    00035     const unsigned char y,
    00036     const unsigned char u,
    00037     const unsigned char v
    00038     ) const;
    00039
    00040
    00041   /**
    00042   * Segments an image to a color class image.
    00043   *
    00044   * This doesn't need to used in the image processor, but is needed for visualisation
    00045   * of color tables.
    00046   * @param image A reference to the image to be segmented
    00047   * @param colorClassImage A reference to the color class image to be created
    00048   * @return A reference to the created color class image.
    00049   */
    00050   virtual void generateColorClassImage(
    00051     const Image& image,
    00052     ColorClassImage& colorClassImage) const;
    00053
    00054   void clear();
    00055
    00056   void setThresholds(
    00057     colorClass color,
    00058     int minY, int minU, int minV, int maxY, int maxU, int maxV
    00059     );
    00060
    00061   int getThresholdMin(colorClass color, int channel) const;
    00062   int getThresholdMax(colorClass color, int channel) const;
    00063
    00064
    00065 private:
    00066   int thresholdMin[numOfColors][3];
    00067   int thresholdMax[numOfColors][3];
    00068   unsigned long int lastTimeWhenThresholdWasSet[numOfColors];
    00069 };
    00070
    00071 /**
    00072  * Streaming operator that reads ColorTableCuboids from a stream.
    00073  * @param stream The stream from which is read.
    00074  * @param colorTableCuboids The ColorTableCuboids object.
    00075  * @return The stream.
    00076  */
    00077 In& operator>>(In& stream, ColorTableCuboids& colorTableCuboids);
    00078
    00079 /**
    00080  * Streaming operator that writes GridImageProcessor2Parameters to a stream.
    00081  * @param stream The stream to write on.
    00082  * @param colorTableCuboids The ColorTableCuboids object.
    00083  * @return The stream.
    00084  */
    00085 Out& operator<<(Out& stream, const ColorTableCuboids& colorTableCuboids);
    00086
    00087
    00088
    00089 #endif   //  _ColorTableCuboids_h_