SceneGenerator.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef SCENEGENERATOR_H
00039 #define SCENEGENERATOR_H
00040
00041 #include "Image/Image.H"
00042 #include "Image/Pixels.H"
00043 #include "Raster/Raster.H"
00044 #include "Media/TestImages.H"
00045
00046 #include <vector>
00047 #include <string>
00048
00049 class SceneGenerator
00050 {
00051 public :
00052 enum SceneType {SIMPLE_EDGES, SIMPLE_SHAPES, ALOI_OBJECTS, COIL_OBJECTS, SATELLITE_KATRINA, MIT_LABELME};
00053
00054 struct ObjectInfo
00055 {
00056 Point2D<int> loc;
00057 int objId;
00058
00059 ObjectInfo(Point2D<int> l, int id): loc(l), objId(id) {}
00060 };
00061
00062
00063 SceneGenerator(SceneType sceneType, int width = 255, int height = 255);
00064
00065
00066 ~SceneGenerator();
00067
00068
00069 Image<PixRGB<byte> > getScene(int nobj, int lum=-1, int col=-1, int rot=-1);
00070
00071
00072 bool checkTargetPos(const Point2D<int> &pt, const Dims &searchWin);
00073
00074
00075 int getObjFromPos(const Point2D<int> &pt, const Dims &searchWin);
00076
00077
00078 const Point2D<int> getTargetPos() const;
00079
00080 void setSceneType(SceneType sceneId);
00081
00082
00083 void setTargetObject(int obj);
00084
00085
00086 void setObjectSize(int size);
00087
00088
00089 void setTargetColor(PixRGB<byte> color);
00090
00091
00092 void setLum(int lum);
00093
00094
00095 void setColor(PixRGB<byte> color);
00096
00097
00098 void setNoise(int level);
00099
00100
00101 void setRotation(int rot);
00102
00103
00104 void setBackgroundColor(PixRGB<byte> color);
00105
00106
00107
00108 int getTargetObject();
00109
00110
00111 int getObjectSize();
00112
00113
00114 PixRGB<byte> getTargetColor();
00115
00116
00117 int getLum();
00118
00119
00120 PixRGB<byte> getColor();
00121
00122
00123 int getNoise();
00124
00125
00126 int getRotation();
00127
00128
00129 PixRGB<byte> getBackgroundColor();
00130
00131
00132 SceneType getSceneType();
00133
00134
00135 Image<PixRGB<byte> > getLabelMeScene();
00136
00137
00138 Point2D<int> getObjLocation(uint objId);
00139
00140
00141 int getObjId(uint objId);
00142
00143
00144 uint getNumObj();
00145
00146 static const int numSceneTypeNames = 6;
00147
00148
00149 const char * getSceneTypeNames(SceneType id){
00150 ASSERT(id < numSceneTypeNames);
00151 static const char* SceneTypeNames[numSceneTypeNames] = {
00152 "Simple Edges",
00153 "Simple Shapes",
00154 "Aloi Objects",
00155 "Coil Objects",
00156 "Satellite: Katrina",
00157 "Mit LabelMe"
00158 };
00159
00160 return SceneTypeNames[id];
00161 }
00162
00163 uint getNumSceneTypes();
00164
00165 private:
00166
00167 Image<PixRGB<byte> > generateAloiObjectsScene(int nobj, int lum, int col, int rot);
00168 Image<PixRGB<byte> > generateCoilObjectsScene(int nobj);
00169 Image<PixRGB<byte> > generateShapeScene();
00170 Image<PixRGB<byte> > generateEdgeScene();
00171 Image<PixRGB<byte> > getSceneFile();
00172
00173 void readDirScenes(const char *path);
00174
00175
00176
00177
00178 SceneType itsSceneType;
00179 int itsWidth;
00180 int itsHeight;
00181 TestImages *itsALOIImages;
00182 TestImages *itsCoilImages;
00183 TestImages *itsTestImages;
00184 std::vector<Point2D<int> > itsTargetsLoc;
00185 std::vector<ObjectInfo> itsObjLocation;
00186 int itsTargetObject;
00187 int itsObjectSize;
00188 PixRGB<byte> itsTargetColor;
00189 int itsLum;
00190 int itsRot;
00191 PixRGB<byte> itsColor;
00192 int itsNoise;
00193 PixRGB<byte> itsBackgroundColor;
00194 std::vector<std::string> sceneFilenames;
00195
00196 };
00197
00198 #endif
00199
00200
00201
00202
00203
00204