00001
00002
00003
00004
00005
00006
00007 #ifndef __Image_h_
00008 #define __Image_h_
00009
00010 #include "CameraInfo.h"
00011
00012
00013 class Image;
00014
00015 #include "Tools/Streams/InOut.h"
00016 #include "Representations/Perception/ColorTable.h"
00017 #include "Tools/ColorClasses.h"
00018 #include "Tools/Math/Common.h"
00019 #include <string.h>
00020
00021
00022
00023
00024 class Image
00025 {
00026 public:
00027
00028 Image();
00029
00030
00031 ~Image();
00032
00033 bool hasColorTable(void);
00034 void setColorTable(const ColorTable* ct);
00035 char getClassifiedColor(int x, int y) const;
00036 char getClassifiedColor(unsigned long index) const;
00037
00038
00039
00040
00041 void convertFromYCbCrToRGB(const Image& ycbcrImage);
00042
00043
00044
00045
00046 void convertFromRGBToYCbCr(const Image& rgbImage);
00047
00048
00049
00050
00051 void convertFromYCbCrToHSI(const Image& ycrcbImage);
00052
00053
00054
00055
00056 void convertFromHSIToYCbCr(const Image& hsiImage);
00057
00058
00059
00060
00061 void convertFromYCbCrToTSL(const Image& ycbcrImage);
00062
00063
00064
00065
00066
00067
00068 unsigned char getHighResY(int x, int y) const;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 void setHighResY(int x, int y, unsigned char tl, unsigned char bl, unsigned char tr, unsigned char br);
00079
00080
00081
00082
00083
00084 Image& operator=(const Image& other)
00085 {
00086 memcpy((void *)this, (const void *)&other, sizeof(Image));
00087 return *this;
00088 }
00089
00090
00091
00092
00093
00094
00095
00096 unsigned char image[cameraResolutionHeight_ERS7][6][cameraResolutionWidth_ERS7];
00097
00098 CameraInfo cameraInfo;
00099
00100
00101 unsigned long frameNumber;
00102
00103
00104 const ColorTable* colorTable;
00105
00106
00107
00108
00109 void setCameraInfo();
00110 };
00111
00112
00113
00114
00115
00116
00117
00118 Out& operator<<(Out& stream, const Image& image);
00119
00120
00121
00122
00123
00124
00125
00126 In& operator>>(In& stream,Image& image);
00127
00128 #endif //__Image_h_