DiskGrabber¶
- class DiskGrabber(*args, **kwargs)¶
Bases:
FrameGrabber
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.
Note
See vpFrameGrabber
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.
#include <visp3/core/vpImage.h> #include <visp3/io/vpDiskGrabber.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main(){ vpImage<unsigned char> I; // Grey level image // Declare a framegrabber able to read a sequence of successive // images from the disk vpDiskGrabber g; // Set the path to the directory containing the sequence g.setDirectory("/local/soft/ViSP/ViSP-images/cube"); // Set the image base name. The directory and the base name constitute // the constant part of the full filename g.setBaseName("image."); // Set the step between two images of the sequence g.setStep(2); // Set the number of digits to build the image number g.setNumberOfZero(4); // Set the first frame number of the sequence g.setImageNumber(1); // Set the image file extension g.setExtension("pgm"); // Open the framegrabber by loading the first image of the sequence g.open(I) ; unsigned int cpt = 1; // this is the loop over the image sequence while(cpt ++ < 10) { // read the image and then increment the image counter so that the next // call to acquire(I) will get the next image g.acquire(I) ; } }
Overloaded function.
__init__(self: visp._visp.io.DiskGrabber) -> None
Default constructor.
__init__(self: visp._visp.io.DiskGrabber, genericName: str) -> None
__init__(self: visp._visp.io.DiskGrabber, dir: str, basename: str, number: int, step: int, noz: int, ext: str) -> None
Methods
Overloaded function.
Overloaded function.
Not useful.
Return the name of the file in which the last frame was read.
Return the current image number.
Overloaded function.
Set the image base name.
Set the main directory name (ie location of the image sequence).
Set the image extension.
Set the image generic name like image-%04d.png .
Set the number of the image to be read.
Set the step between two images.
Set the step between two images.
Inherited Methods
init
Return the number of rows in the image.
Return the number of columns in the image.
Operators
__doc__
Overloaded function.
__module__
Attributes
__annotations__
init
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.io.DiskGrabber) -> None
Default constructor.
__init__(self: visp._visp.io.DiskGrabber, genericName: str) -> None
__init__(self: visp._visp.io.DiskGrabber, dir: str, basename: str, number: int, step: int, noz: int, ext: str) -> None
- acquire(*args, **kwargs)¶
Overloaded function.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageGray) -> None
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
- Parameters:
- I
The image read from a file.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageRGBa) -> None
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
- Parameters:
- I
The image read from a file.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageFloat) -> None
Acquire an image reading the next image from the disk. After this call, the image number is incremented considering the step.
- Parameters:
- I
The image read from a file.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageGray, image_number: int) -> None
Acquire an image reading the image with number img_number from the disk. After this call, the image number is incremented considering the step.
- Parameters:
- I
The image read from a file.
- image_number
The number of the desired image.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageRGBa, image_number: int) -> None
Acquire an image reading the image with number img_number from the disk. After this call, the image number is incremented considering the step.
- Parameters:
- I
The image read from a file.
- image_number
The number of the desired image.
acquire(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageFloat, image_number: int) -> None
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.
- Parameters:
- I
The image read from a file.
- image_number
The number of the desired image.
- close(self) None ¶
Not useful.
Does nothing. Here for compatibility issue with the vpFrameGrabber class.
- open(*args, **kwargs)¶
Overloaded function.
open(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageGray) -> None
Read the first image of the sequence. The image number is not incremented.
open(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageRGBa) -> None
Read the first image of the sequence. The image number is not incremented.
open(self: visp._visp.io.DiskGrabber, I: visp._visp.core.ImageFloat) -> None
Read the first image of the sequence. The image number is not incremented.