Visual Servoing Platform
version 3.0.1
|
#include <visp3/io/vpDiskGrabber.h>
Public Member Functions | |
vpDiskGrabber () | |
vpDiskGrabber (const char *genericName) | |
vpDiskGrabber (const char *dir, const char *basename, long number, int step, unsigned int noz, const char *ext) | |
virtual | ~vpDiskGrabber () |
void | open (vpImage< unsigned char > &I) |
void | open (vpImage< vpRGBa > &I) |
void | open (vpImage< float > &I) |
void | acquire (vpImage< unsigned char > &I) |
void | acquire (vpImage< vpRGBa > &I) |
void | acquire (vpImage< float > &I) |
void | acquire (vpImage< unsigned char > &I, long image_number) |
void | acquire (vpImage< vpRGBa > &I, long image_number) |
void | acquire (vpImage< float > &I, long image_number) |
void | close () |
void | setDirectory (const char *dir) |
void | setBaseName (const char *name) |
void | setImageNumber (long number) |
void | setStep (int a) |
void | setNumberOfZero (unsigned int noz) |
void | setExtension (const char *ext) |
void | setGenericName (const char *genericName) |
long | getImageNumber () |
Inherited functionalities from vpFramegrabber | |
unsigned int | getHeight () const |
unsigned int | getWidth () const |
Public Attributes | |
bool | init |
Protected Attributes | |
unsigned int | height |
unsigned int | width |
Class to grab (ie. read) images from the disk.
Defined a virtual video device. "Grab" the images from the disk. Derived from the vpFrameGrabber class.
Here an example of capture from the directory "/local/soft/ViSP/ViSP-images/cube". We want to acquire 10 images from the first named "image.0001.pgm" by steps of 2.
Definition at line 106 of file vpDiskGrabber.h.
vpDiskGrabber::vpDiskGrabber | ( | ) |
Elementary constructor.
Definition at line 45 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init, setBaseName(), setDirectory(), and setExtension().
vpDiskGrabber::vpDiskGrabber | ( | const char * | genericName | ) |
Definition at line 56 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init, vpException::memoryAllocationError, setBaseName(), setDirectory(), and setExtension().
vpDiskGrabber::vpDiskGrabber | ( | const char * | dir, |
const char * | basename, | ||
long | number, | ||
int | step, | ||
unsigned int | noz, | ||
const char * | ext | ||
) |
Constructor.
dir | : Location of the image sequence. |
basename | : Base name of each image. |
number | : Initial image number. |
step | : Increment between two images. |
noz | : Number of zero to code the image number. |
ext | : Extension of the image file. |
Definition at line 85 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init, setBaseName(), setDirectory(), and setExtension().
|
virtual |
|
virtual |
Acquire an image: read a pgm image from the disk. After this call, the image number is incremented considering the step.
I | the read image |
Implements vpFrameGrabber.
Definition at line 168 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), vpDEBUG_TRACE, and vpFrameGrabber::width.
Referenced by vpVideoReader::acquire(), vpVideoReader::getFrame(), and open().
Acquire an image: read a ppm image from the disk. After this call, the image number is incremented considering the step.
I | the read image |
Implements vpFrameGrabber.
Definition at line 195 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), vpDEBUG_TRACE, and vpFrameGrabber::width.
void vpDiskGrabber::acquire | ( | vpImage< float > & | I | ) |
Acquire an image: read a pfm image from the disk. After this call, the image number is incremented considering the step.
I | the read image |
Definition at line 223 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::readPFM(), vpDEBUG_TRACE, and vpFrameGrabber::width.
void vpDiskGrabber::acquire | ( | vpImage< unsigned char > & | I, |
long | img_number | ||
) |
Acquire an image: read a pgm image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
img_number | : The number of the desired image. |
Definition at line 252 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), vpDEBUG_TRACE, and vpFrameGrabber::width.
Acquire an image: read a ppm image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
img_number | : The number of the desired image. |
Definition at line 278 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), vpDEBUG_TRACE, and vpFrameGrabber::width.
void vpDiskGrabber::acquire | ( | vpImage< float > & | I, |
long | img_number | ||
) |
Acquire an image: read a pfm image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
img_number | : The number of the desired image. |
Definition at line 306 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::readPFM(), vpDEBUG_TRACE, and vpFrameGrabber::width.
|
virtual |
Not useful
Here for compatibility issue with the vpFrameGrabber class
Implements vpFrameGrabber.
Definition at line 331 of file vpDiskGrabber.cpp.
|
inlineinherited |
Return the number of rows in the image.
Definition at line 115 of file vpFrameGrabber.h.
|
inline |
Return the current image number.
Definition at line 152 of file vpDiskGrabber.h.
Referenced by open().
|
inlineinherited |
Return the number of columns in the image.
Definition at line 117 of file vpFrameGrabber.h.
|
virtual |
Implements vpFrameGrabber.
Definition at line 99 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), vpDEBUG_TRACE, and vpFrameGrabber::width.
Read the fist image of the sequence. The image number is not incremented.
Implements vpFrameGrabber.
Definition at line 121 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), vpDEBUG_TRACE, and vpFrameGrabber::width.
void vpDiskGrabber::open | ( | vpImage< float > & | I | ) |
Read the fist image of the sequence. The image number is not incremented.
Definition at line 144 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), vpDEBUG_TRACE, and vpFrameGrabber::width.
void vpDiskGrabber::setBaseName | ( | const char * | name | ) |
Set the image base name.
Definition at line 360 of file vpDiskGrabber.cpp.
Referenced by vpDiskGrabber().
void vpDiskGrabber::setDirectory | ( | const char * | dir | ) |
Set the main directory name (ie location of the image sequence)
Definition at line 351 of file vpDiskGrabber.cpp.
Referenced by vpDiskGrabber().
void vpDiskGrabber::setExtension | ( | const char * | ext | ) |
Set the image extension.
Definition at line 369 of file vpDiskGrabber.cpp.
Referenced by vpDiskGrabber().
void vpDiskGrabber::setGenericName | ( | const char * | genericName | ) |
Definition at line 403 of file vpDiskGrabber.cpp.
References vpException::memoryAllocationError.
Referenced by vpVideoReader::open().
void vpDiskGrabber::setImageNumber | ( | long | number | ) |
Set the number of the image to be read.
Definition at line 378 of file vpDiskGrabber.cpp.
References vpDEBUG_TRACE.
Referenced by open(), and vpVideoReader::open().
void vpDiskGrabber::setNumberOfZero | ( | unsigned int | noz | ) |
Set the step between two images.
Definition at line 397 of file vpDiskGrabber.cpp.
void vpDiskGrabber::setStep | ( | int | step | ) |
Set the step between two images.
Definition at line 389 of file vpDiskGrabber.cpp.
|
protectedinherited |
Number of rows in the image.
Definition at line 108 of file vpFrameGrabber.h.
Referenced by acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vp1394TwoGrabber::getHeight(), open(), vpV4l2Grabber::open(), vp1394CMUGrabber::open(), vpVideoReader::open(), vp1394TwoGrabber::setFormat7ROI(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().
|
inherited |
Set to true if the frame grabber has been initialized.
Definition at line 105 of file vpFrameGrabber.h.
Referenced by vpV4l2Grabber::acquire(), vp1394CMUGrabber::close(), vp1394TwoGrabber::close(), vpFlyCaptureGrabber::connect(), vpFlyCaptureGrabber::disconnect(), open(), vpV4l2Grabber::open(), vp1394TwoGrabber::resetBus(), vpFlyCaptureGrabber::startCapture(), vpFlyCaptureGrabber::stopCapture(), vp1394CMUGrabber::vp1394CMUGrabber(), vp1394TwoGrabber::vp1394TwoGrabber(), vpDiskGrabber(), and vpV4l2Grabber::vpV4l2Grabber().
|
protectedinherited |
Number of columns in the image.
Definition at line 109 of file vpFrameGrabber.h.
Referenced by acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vp1394TwoGrabber::getWidth(), open(), vpV4l2Grabber::open(), vp1394CMUGrabber::open(), vpVideoReader::open(), vp1394TwoGrabber::setFormat7ROI(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().