00001
00002
00003
00004
00005
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
00016
00017
00018
00019 class ColorTableCuboids : public ColorTable
00020 {
00021 public:
00022
00023 ColorTableCuboids();
00024
00025
00026 ~ColorTableCuboids();
00027
00028
00029
00030
00031
00032
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
00043
00044
00045
00046
00047
00048
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
00073
00074
00075
00076
00077 In& operator>>(In& stream, ColorTableCuboids& colorTableCuboids);
00078
00079
00080
00081
00082
00083
00084
00085 Out& operator<<(Out& stream, const ColorTableCuboids& colorTableCuboids);
00086
00087
00088
00089 #endif // _ColorTableCuboids_h_