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

# Modules/ImageProcessor/ImageProcessorTools/ColorTableReferenceColor.h

Go to the documentation of this file.

    00001 /**
    00002 * @file ColorTableReferenceColor.h
    00003 * Declaration of class ColorTableReferenceColor.
    00004 *
    00005 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00006 */
    00007
    00008 #ifndef _ColorTableReferenceColor_h_
    00009 #define _ColorTableReferenceColor_h_
    00010
    00011 #include "Representations/Perception/Image.h"
    00012 #include "Tools/ColorClasses.h"
    00013
    00014 /**
    00015 * @class ColorTableReferenceColor
    00016 *
    00017 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00018 */
    00019 class ColorTableReferenceColor : public ColorTable
    00020 {
    00021 public:
    00022   /** Constructor */
    00023   ColorTableReferenceColor();
    00024
    00025   /** Destructor */
    00026   ~ColorTableReferenceColor();
    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 an 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
    00055   int getAverageGreen(int channel) const;
    00056   int getGreenMin(int channel) const;
    00057   int getGreenMax(int channel) const;
    00058
    00059   void setGreenMin(int channel, int value);
    00060   void setGreenMax(int channel, int value);
    00061
    00062   void expandGreen(int greenMin[3], int greenMax[3]);
    00063
    00064   void clear();
    00065
    00066 private:
    00067   void setGreen();
    00068
    00069   int averageGreen[3];
    00070   int greenMin[3];
    00071   int greenMax[3];
    00072
    00073   bool greenIsValid;
    00074   int setGreenCounter;
    00075
    00076   int skyblueAutoMin[3];
    00077   int skyblueAutoMax[3];
    00078
    00079   int yellowAutoMin[3];
    00080   int yellowAutoMax[3];
    00081
    00082   int orangeAutoMin[3];
    00083   int orangeAutoMax[3];
    00084
    00085   int pinkAutoMin[3];
    00086   int pinkAutoMax[3];
    00087
    00088   int redAutoMin[3];
    00089   int redAutoMax[3];
    00090
    00091   int whiteAutoMin[3];
    00092   int whiteAutoMax[3];
    00093
    00094   int whiteFixedMin[3];
    00095   int whiteFixedMax[3];
    00096 };
    00097
    00098 /**
    00099  * Streaming operator that reads ColorTableReferenceColor from a stream.
    00100  * @param stream The stream from which is read.
    00101  * @param colorTableReferenceColor The ColorTableReferenceColor object.
    00102  * @return The stream.
    00103  */
    00104 In& operator>>(In& stream, ColorTableReferenceColor& colorTableReferenceColor);
    00105
    00106 /**
    00107  * Streaming operator that writes GridImageProcessor2Parameters to a stream.
    00108  * @param stream The stream to write on.
    00109  * @param colorTableReferenceColor The ColorTableReferenceColor object.
    00110  * @return The stream.
    00111  */
    00112 Out& operator<<(Out& stream, const ColorTableReferenceColor& colorTableReferenceColor);
    00113
    00114
    00115
    00116 #endif   //  _ColorTableReferenceColor_h_