|
libeblearntools
|
#include <camera_directory.h>
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. | |
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.
| 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.
| directory | The root directory to recursively search. |
| height | Resize input frame to this height if different than -1. |
| width | Resize input frame to this width if different than -1. |
| randomize | Randomize image list if true. |
| npasses | Repeat list this number of times. |
| file_pattern | The regexp defining the files patterns to search. |
| files | An optional list of files to search for in 'directory' instead of using the file pattern. |
| 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.
| height | Resize input frame to this height if different than -1. |
| width | Resize input frame to this width if different than -1. |
| randomize | Randomize image list if true. |
| npasses | Repeat list this number of times. |
| file_pattern | The regexp defining the files patterns to search. |
| string ebl::camera_directory< Tdata >::get_subdir | ( | ) | [virtual] |
Return the subdirectory name for the current frame, relative to the global input directory.
| 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 >.
| 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 >.
files_list* ebl::camera_directory< Tdata >::fl [protected] |
< error output stream
list of images