Visual Servoing Platform
version 3.6.1 under development (2024-12-17)
|
#include <visp3/io/vpDiskGrabber.h>
Public Member Functions | |
vpDiskGrabber () | |
VP_EXPLICIT | vpDiskGrabber (const std::string &genericName) |
virtual | ~vpDiskGrabber () |
VP_EXPLICIT | vpDiskGrabber (const std::string &dir, const std::string &basename, long number, int step, unsigned int noz, const std::string &ext) |
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 () |
long | getImageNumber () const |
std::string | getImageName () const |
void | open (vpImage< unsigned char > &I) |
void | open (vpImage< vpRGBa > &I) |
void | open (vpImage< float > &I) |
void | setBaseName (const std::string &name) |
void | setDirectory (const std::string &dir) |
void | setExtension (const std::string &ext) |
void | setGenericName (const std::string &genericName) |
void | setImageNumber (long number) |
void | setNumberOfZero (unsigned int noz) |
void | setStep (long step) |
Public Attributes | |
bool | init |
Inherited functionalities from vpFramegrabber | |
unsigned int | getHeight () const |
unsigned int | getWidth () const |
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 108 of file vpDiskGrabber.h.
BEGIN_VISP_NAMESPACE vpDiskGrabber::vpDiskGrabber | ( | ) |
Default constructor.
Definition at line 38 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init.
vpDiskGrabber::vpDiskGrabber | ( | const std::string & | genericName | ) |
Constructor that takes a generic image sequence as input.
Definition at line 46 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init.
|
inlinevirtual |
Destructor. In fact nothing to destroy...
Definition at line 140 of file vpDiskGrabber.h.
vpDiskGrabber::vpDiskGrabber | ( | const std::string & | dir, |
const std::string & | basename, | ||
long | number, | ||
int | step, | ||
unsigned int | noz, | ||
const std::string & | 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 53 of file vpDiskGrabber.cpp.
References vpFrameGrabber::init.
void vpDiskGrabber::acquire | ( | vpImage< float > & | I | ) |
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
Definition at line 153 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::readPFM(), and vpFrameGrabber::width.
void vpDiskGrabber::acquire | ( | vpImage< float > & | I, |
long | image_number | ||
) |
Acquire an image reading the pfm image with number img_number from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
image_number | : The number of the desired image. |
Definition at line 219 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::readPFM(), and vpFrameGrabber::width.
|
virtual |
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
Implements vpFrameGrabber.
Definition at line 107 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), and vpFrameGrabber::width.
Referenced by vpVideoReader::acquire(), vpVideoReader::getFrame(), and open().
void vpDiskGrabber::acquire | ( | vpImage< unsigned char > & | I, |
long | image_number | ||
) |
Acquire an image reading the image with number img_number from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
image_number | : The number of the desired image. |
Definition at line 175 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), and vpFrameGrabber::width.
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
Implements vpFrameGrabber.
Definition at line 130 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), and vpFrameGrabber::width.
Acquire an image reading the image with number img_number from the disk. After this call, the image number is incremented considering the step.
I | : The image read from a file. |
image_number | : The number of the desired image. |
Definition at line 197 of file vpDiskGrabber.cpp.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageIo::read(), and vpFrameGrabber::width.
|
inlinevirtual |
Not useful.
Does nothing. Here for compatibility issue with the vpFrameGrabber class.
Implements vpFrameGrabber.
Definition at line 211 of file vpDiskGrabber.h.
|
inherited |
Return the number of rows in the image.
Definition at line 38 of file vpFrameGrabber.cpp.
References vpFrameGrabber::height.
|
inline |
Return the name of the file in which the last frame was read.
Definition at line 221 of file vpDiskGrabber.h.
Referenced by vpVideoReader::acquire().
|
inline |
Return the current image number.
Definition at line 216 of file vpDiskGrabber.h.
Referenced by vpVideoReader::acquire(), vpVideoReader::getFrame(), and open().
|
inherited |
Return the number of columns in the image.
Definition at line 43 of file vpFrameGrabber.cpp.
References vpFrameGrabber::width.
void vpDiskGrabber::open | ( | vpImage< float > & | I | ) |
Read the first image of the sequence. The image number is not incremented.
Definition at line 91 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), and vpFrameGrabber::width.
|
virtual |
Read the first image of the sequence. The image number is not incremented.
Implements vpFrameGrabber.
Definition at line 61 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), and vpFrameGrabber::width.
Read the first image of the sequence. The image number is not incremented.
Implements vpFrameGrabber.
Definition at line 75 of file vpDiskGrabber.cpp.
References acquire(), vpImage< Type >::getHeight(), getImageNumber(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpFrameGrabber::init, setImageNumber(), and vpFrameGrabber::width.
|
inline |
Set the image base name.
Definition at line 244 of file vpDiskGrabber.h.
|
inline |
Set the main directory name (ie location of the image sequence).
Definition at line 249 of file vpDiskGrabber.h.
|
inline |
Set the image extension.
Definition at line 254 of file vpDiskGrabber.h.
void vpDiskGrabber::setGenericName | ( | const std::string & | genericName | ) |
Set the image generic name like image-%04d.png
.
Definition at line 247 of file vpDiskGrabber.cpp.
void vpDiskGrabber::setImageNumber | ( | long | number | ) |
Set the number of the image to be read.
Definition at line 241 of file vpDiskGrabber.cpp.
Referenced by vpVideoReader::acquire(), vpVideoReader::getFrame(), and open().
|
inline |
Set the step between two images.
Definition at line 269 of file vpDiskGrabber.h.
|
inline |
Set the step between two images.
Definition at line 274 of file vpDiskGrabber.h.
Referenced by vpVideoReader::acquire().
|
protectedinherited |
Number of rows in the image.
Definition at line 134 of file vpFrameGrabber.h.
Referenced by acquire(), vpPylonGrabberGigE::acquire(), vpPylonGrabberUsb::acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getHeight(), vp1394TwoGrabber::getHeight(), open(), vp1394CMUGrabber::open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().
|
inherited |
Set to true if the frame grabber has been initialized.
Definition at line 102 of file vpFrameGrabber.h.
Referenced by vpV4l2Grabber::acquire(), vp1394CMUGrabber::close(), vp1394TwoGrabber::close(), vpFlyCaptureGrabber::connect(), vpPylonGrabberGigE::connect(), vpPylonGrabberUsb::connect(), vpFlyCaptureGrabber::disconnect(), vpPylonGrabberGigE::disconnect(), vpPylonGrabberUsb::disconnect(), open(), vpV4l2Grabber::open(), vp1394TwoGrabber::resetBus(), vpFlyCaptureGrabber::startCapture(), vpPylonGrabberGigE::startCapture(), vpPylonGrabberUsb::startCapture(), vpFlyCaptureGrabber::stopCapture(), vpPylonGrabberGigE::stopCapture(), vpPylonGrabberUsb::stopCapture(), vp1394CMUGrabber::vp1394CMUGrabber(), vp1394TwoGrabber::vp1394TwoGrabber(), vpDiskGrabber(), and vpV4l2Grabber::vpV4l2Grabber().
|
protectedinherited |
Number of columns in the image.
Definition at line 135 of file vpFrameGrabber.h.
Referenced by acquire(), vpPylonGrabberGigE::acquire(), vpPylonGrabberUsb::acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getWidth(), vp1394TwoGrabber::getWidth(), open(), vp1394CMUGrabber::open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().