
#include <Media/TestImages.H>

Classes | |
| struct | ObjData |
| struct | SceneData |
Public Types | |
| enum | LIBRARY { ALOI, CSAIL, COIL, MIT_LABELME, CALTECH256, CSCLAB, IMG_DIR, XMLFILE } |
Types of libraries available. More... | |
| enum | USETYPE { TRAIN, TEST, ALL } |
Possible uses. More... | |
Public Member Functions | |
| TestImages (const char *imagesPath, LIBRARY lib, const int numTraining=-1, const int numTesting=-1, const int numObjects=-1) | |
| Constructor. | |
| Image< PixRGB< byte > > | getObject (int id=-1, int lum=-1, int col=-2, int rot=-2) |
| SceneData | getSceneData (uint scene, USETYPE useType=ALL) |
| return the scene data | |
| ObjData | getObjectData (uint scene, uint obj, bool getImage=false) |
| ObjData | getObjFromPos (uint scene, const Point2D< int > &pt) |
| get the obj in this position | |
| Image< PixRGB< byte > > | getScene (uint sceneId, USETYPE useType=ALL) |
| std::string | getSceneFilename (uint sceneId) |
| Image< PixRGB< byte > > | getLabelMeScene (uint sceneId) |
| Image< PixRGB< byte > > | getCscLabScene (uint sceneId) |
| Image< PixRGB< byte > > | generateScene (uint scene) |
| generate a scene from its objects | |
| uint | getMaxLum () |
| uint | getMaxCol () |
| uint | getMaxRot () |
| uint | getNumObj (uint scene=0) |
| get the number of objects in a scene | |
| uint | getNumScenes (USETYPE useType=ALL) |
| get the max number of scenes we have | |
| const char * | getObjName (uint id) |
| get the object name | |
| std::vector< Point2D< int > > | getObjPolygon (uint id) |
| get the polygon encompesing the obj | |
| Image< byte > | getObjMask (uint id) |
| get an object mask (use current scene) | |
| Image< byte > | getObjMask (uint scene, uint obj) |
| get an object mask | |
| Image< byte > | getObjMask (uint scene, uint obj, const Dims &sceneDims) |
| get an object mask | |
| Image< byte > | getAllObjMask () |
| get a mask from all objects | |
| int | labelScene (uint scene, Image< PixRGB< byte > > &sceneImg) |
| label a scene from avilable polygons | |
| void | setRootPath (std::string path) |
| Set the root path. | |
Definition at line 55 of file TestImages.H.
| enum TestImages::LIBRARY |
Types of libraries available.
Definition at line 59 of file TestImages.H.
| enum TestImages::USETYPE |
Possible uses.
Definition at line 63 of file TestImages.H.
| TestImages::TestImages | ( | const char * | imagesPath, | |
| LIBRARY | lib, | |||
| const int | numTraining = -1, |
|||
| const int | numTesting = -1, |
|||
| const int | numObjects = -1 | |||
| ) |
Constructor.
Definition at line 76 of file TestImages.C.
generate a scene from its objects
Definition at line 465 of file TestImages.C.
References ASSERT, filename, getObjectData(), Dims::h(), inplacePaste(), NO_INIT, pasteImage(), Raster::ReadRGB(), rescale(), and Dims::w().
get a mask from all objects
Definition at line 930 of file TestImages.C.
References Image< T >::getHeight(), getNumObj(), getObjPolygon(), Image< T >::getWidth(), pnpoly(), Image< T >::setVal(), and ZEROS.
get the number of objects in a scene
Definition at line 135 of file TestImages.C.
References ASSERT.
Referenced by getAllObjMask(), and labelScene().
get the max number of scenes we have
Definition at line 586 of file TestImages.C.
| Image< PixRGB< byte > > TestImages::getObject | ( | int | id = -1, |
|
| int | lum = -1, |
|||
| int | col = -2, |
|||
| int | rot = -2 | |||
| ) |
Return a single object if lum or col or rot are -1, then return a random of that type
Definition at line 256 of file TestImages.C.
References filename, Raster::ReadRGB(), and sformat().
| TestImages::ObjData TestImages::getObjectData | ( | uint | scene, | |
| uint | obj, | |||
| bool | getImage = false | |||
| ) |
Return an ObjData for a single object load the image when the object is requested to save on memory
Definition at line 339 of file TestImages.C.
References ASSERT, filename, Point2D< T >::i, and Raster::ReadRGB().
Referenced by generateScene(), and labelScene().
| TestImages::ObjData TestImages::getObjFromPos | ( | uint | scene, | |
| const Point2D< int > & | pt | |||
| ) |
get the obj in this position
Definition at line 424 of file TestImages.C.
References ASSERT, Point2D< T >::i, and pnpoly().
get an object mask
Definition at line 915 of file TestImages.C.
References ASSERT, drawFilledPolygon(), Image< T >::getHeight(), Image< T >::getWidth(), and ZEROS.
get an object mask
Definition at line 899 of file TestImages.C.
References ASSERT, drawFilledPolygon(), Image< T >::getHeight(), Image< T >::getWidth(), and ZEROS.
get an object mask (use current scene)
Definition at line 889 of file TestImages.C.
References drawFilledPolygon(), Image< T >::getDims(), getObjPolygon(), and ZEROS.
| const char * TestImages::getObjName | ( | uint | id | ) |
| std::vector< Point2D< int > > TestImages::getObjPolygon | ( | uint | id | ) |
get the polygon encompesing the obj
Definition at line 882 of file TestImages.C.
References ASSERT.
Referenced by getAllObjMask(), and getObjMask().
| TestImages::SceneData TestImages::getSceneData | ( | uint | scene, | |
| USETYPE | useType = ALL | |||
| ) |
label a scene from avilable polygons
Definition at line 1197 of file TestImages.C.
References getNumObj(), getObjectData(), Point2D< T >::i, and writeText().
| void TestImages::setRootPath | ( | std::string | path | ) | [inline] |
Set the root path.
Definition at line 157 of file TestImages.H.
1.6.3