TestImages Class Reference

TestImages. More...

#include <Media/TestImages.H>

Collaboration diagram for TestImages:
Collaboration graph
[legend]

List of all members.

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< bytegetObjMask (uint id)
 get an object mask (use current scene)
Image< bytegetObjMask (uint scene, uint obj)
 get an object mask
Image< bytegetObjMask (uint scene, uint obj, const Dims &sceneDims)
 get an object mask
Image< bytegetAllObjMask ()
 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.

Detailed Description

TestImages.

Definition at line 55 of file TestImages.H.


Member Enumeration Documentation

Types of libraries available.

Definition at line 59 of file TestImages.H.

Possible uses.

Definition at line 63 of file TestImages.H.


Constructor & Destructor Documentation

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.


Member Function Documentation

Image< PixRGB< byte > > TestImages::generateScene ( uint  scene  ) 

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().

Image< byte > TestImages::getAllObjMask (  ) 

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.

uint TestImages::getNumObj ( uint  scene = 0  ) 

get the number of objects in a scene

Definition at line 135 of file TestImages.C.

References ASSERT.

Referenced by getAllObjMask(), and labelScene().

uint TestImages::getNumScenes ( USETYPE  useType = ALL  ) 

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().

Image< byte > TestImages::getObjMask ( uint  scene,
uint  obj,
const Dims sceneDims 
)

get an object mask

Definition at line 915 of file TestImages.C.

References ASSERT, drawFilledPolygon(), Image< T >::getHeight(), Image< T >::getWidth(), and ZEROS.

Image< byte > TestImages::getObjMask ( uint  scene,
uint  obj 
)

get an object mask

Definition at line 899 of file TestImages.C.

References ASSERT, drawFilledPolygon(), Image< T >::getHeight(), Image< T >::getWidth(), and ZEROS.

Image< byte > TestImages::getObjMask ( uint  id  ) 

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  ) 

get the object name

Definition at line 875 of file TestImages.C.

References ASSERT.

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 
)

return the scene data

Definition at line 403 of file TestImages.C.

References ASSERT.

int TestImages::labelScene ( uint  scene,
Image< PixRGB< byte > > &  sceneImg 
)

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.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:50 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3