libeblearntools
ebl::camera_directory< Tdata > Class Template Reference

#include <camera_directory.h>

Inheritance diagram for ebl::camera_directory< Tdata >:
ebl::camera< Tdata > ebl::camera_video< Tdata >

List of all members.

Public Member Functions

 camera_directory (const char *directory, int height_=-1, int width_=-1, bool randomize=false, uint npasses=1, std::ostream &out=std::cout, std::ostream &err=std::cerr, const char *file_pattern=IMAGE_PATTERN_MAT, const list< string > *files=NULL)
 camera_directory (int height_=-1, int width_=-1, bool randomize=false, uint npasses=1, std::ostream &out=std::cout, std::ostream &err=std::cerr, const char *file_pattern=IMAGE_PATTERN_MAT)
bool read_directory (const char *directory)
 Find all images recursively from this directory.
virtual ~camera_directory ()
 Destructor.
virtual idx< Tdata > grab ()
 Return a new frame.
virtual string grab_filename ()
 Do not read the file, instead return the filename to be grabbed.
virtual void next ()
virtual void previous ()
 Move to the previous frame, without returning the frame.
virtual bool empty ()
 Return true until all images have been processed.
virtual void skip (uint n)
 Skip n frames.
virtual string frame_name ()
 Return a name for current frame.
virtual string frame_fullname ()
 Return the complete filename for current frame (including path).
virtual string get_subdir ()
virtual int remaining ()
 Return the number of frames left to process, -1 if unknown.
virtual int size ()

Protected Attributes

files_list * fl
 < error output stream
files_list::iterator fli
 Iterator on the list of images.
string indir
 input directory name
string fdir
 directory name
string fname
 file name
string subdir
 subdirs to indir.
ostringstream oss
 temporary string
uint flsize
 original size of list
bool randomize
 Randomize order of images or not.
uint npasses
 Number of passes on the list.
const char * file_pattern
 File search regex.

Detailed Description

template<typename Tdata>
class ebl::camera_directory< Tdata >

The camera_directory class interfaces with images found (recursively) in a directory, grabbing all images into idx format, and also to save gui outputs into video files.


Constructor & Destructor Documentation

template<typename Tdata >
ebl::camera_directory< Tdata >::camera_directory ( const char *  directory,
int  height_ = -1,
int  width_ = -1,
bool  randomize = false,
uint  npasses = 1,
std::ostream &  out = std::cout,
std::ostream &  err = std::cerr,
const char *  file_pattern = IMAGE_PATTERN_MAT,
const list< string > *  files = NULL 
)

Initialize a directory camera from a root directory. height and width are optional parameters that resize the input image to those dimensions if given (different than -1). One may want to decrease the input resolution first to speed up operations, for example when computing multiple resolutions.

Parameters:
directoryThe root directory to recursively search.
heightResize input frame to this height if different than -1.
widthResize input frame to this width if different than -1.
randomizeRandomize image list if true.
npassesRepeat list this number of times.
file_patternThe regexp defining the files patterns to search.
filesAn optional list of files to search for in 'directory' instead of using the file pattern.
template<typename Tdata >
ebl::camera_directory< Tdata >::camera_directory ( int  height_ = -1,
int  width_ = -1,
bool  randomize = false,
uint  npasses = 1,
std::ostream &  out = std::cout,
std::ostream &  err = std::cerr,
const char *  file_pattern = IMAGE_PATTERN_MAT 
)

Initialize a directory camera without a root directory. This constructor requires a subsequent call to read_directory to initialize images. height and width are optional parameters that resize the input image to those dimensions if given (different than -1). One may want to decrease the input resolution first to speed up operations, for example when computing multiple resolutions.

Parameters:
heightResize input frame to this height if different than -1.
widthResize input frame to this width if different than -1.
randomizeRandomize image list if true.
npassesRepeat list this number of times.
file_patternThe regexp defining the files patterns to search.

Member Function Documentation

template<typename Tdata >
string ebl::camera_directory< Tdata >::get_subdir ( ) [virtual]

Return the subdirectory name for the current frame, relative to the global input directory.

template<typename Tdata >
void ebl::camera_directory< Tdata >::next ( ) [virtual]

Move to the next frame, without returning the frame. This is called by grab before grabbing. This can be used to get frames infos without grabbing.

Reimplemented from ebl::camera< Tdata >.

template<typename Tdata >
int ebl::camera_directory< Tdata >::size ( ) [virtual]

Return the total number of frames to process from the initialization, of the camera, -1 if unknown.

Reimplemented from ebl::camera< Tdata >.


Member Data Documentation

template<typename Tdata>
files_list* ebl::camera_directory< Tdata >::fl [protected]

< error output stream

list of images


The documentation for this class was generated from the following files: