Visual Servoing Platform  version 3.2.0
vpFrameGrabber Class Referenceabstract

#include <vpFrameGrabber.h>

+ Inheritance diagram for vpFrameGrabber:

Public Member Functions

Inherited functionalities from vpFramegrabber
unsigned int getHeight () const
 
unsigned int getWidth () const
 
 vpFrameGrabber ()
 
virtual ~vpFrameGrabber ()
 
virtual void open (vpImage< unsigned char > &I)=0
 
virtual void open (vpImage< vpRGBa > &I)=0
 
virtual void acquire (vpImage< unsigned char > &I)=0
 
virtual void acquire (vpImage< vpRGBa > &I)=0
 
virtual void close ()=0
 

Public Attributes

bool init
 

Protected Attributes

unsigned int height
 
unsigned int width
 

Detailed Description

Base class for all video devices. It is designed to provide a front end to video sources.

This class should provide a virtual function that allows the acquisition of an image.

The example below shows how to use this class.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/io/vpImageIo.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#include <visp3/sensor/vpV4l2Grabber.h>
int main()
{
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394)
vpFrameGrabber *g; // Generic framegrabber
#if defined( VISP_HAVE_DC1394 )
// specific settings for firewire grabber based on libdc1394-2.x version
g = g_1394_2;
#elif defined( VISP_HAVE_V4L2 )
// specific settings for Video For Linux Two grabber
g_v4l2->setInput(2); // Input 2 on the board
g_v4l2->setWidth(384); // Acquired images are 768 width
g_v4l2->setHeight(288); // Acquired images are 576 height
g_v4l2->setNBuffers(3); // 3 ring buffers to ensure real-time acquisition
g = g_v4l2;
#endif
g->open(I); // Open the framegrabber
g->acquire(I); // Acquire an image
vpImageIo::write(I, "image.pgm"); // Write image on the disk
#endif
}
Author
Eric Marchand (Eric..nosp@m.Marc.nosp@m.hand@.nosp@m.iris.nosp@m.a.fr), Irisa / Inria Rennes

Definition at line 100 of file vpFrameGrabber.h.

Constructor & Destructor Documentation

◆ vpFrameGrabber()

vpFrameGrabber::vpFrameGrabber ( )
inline

Definition at line 119 of file vpFrameGrabber.h.

◆ ~vpFrameGrabber()

virtual vpFrameGrabber::~vpFrameGrabber ( )
inlinevirtual

Definition at line 120 of file vpFrameGrabber.h.

Member Function Documentation

◆ acquire() [1/2]

virtual void vpFrameGrabber::acquire ( vpImage< unsigned char > &  I)
pure virtual

◆ acquire() [2/2]

◆ close()

virtual void vpFrameGrabber::close ( )
pure virtual

This virtual function is used to de-allocate the memory used by a specific frame grabber

Implemented in vpPylonGrabber, vp1394TwoGrabber, vpV4l2Grabber, vpVideoReader, vp1394CMUGrabber, vpFlyCaptureGrabber, vpDiskGrabber, vpDirectShowGrabber, vpPylonGrabberGigE, and vpPylonGrabberUsb.

◆ getHeight()

unsigned int vpFrameGrabber::getHeight ( ) const
inline

Return the number of rows in the image.

Examples
AROgre.cpp, AROgreBasic.cpp, and testPylonGrabber.cpp.

Definition at line 113 of file vpFrameGrabber.h.

◆ getWidth()

unsigned int vpFrameGrabber::getWidth ( ) const
inline

Return the number of columns in the image.

Examples
AROgre.cpp, AROgreBasic.cpp, and testPylonGrabber.cpp.

Definition at line 115 of file vpFrameGrabber.h.

◆ open() [1/2]

virtual void vpFrameGrabber::open ( vpImage< unsigned char > &  I)
pure virtual

◆ open() [2/2]

Member Data Documentation

◆ height

unsigned int vpFrameGrabber::height
protected

Number of rows in the image.

Definition at line 106 of file vpFrameGrabber.h.

Referenced by vpDirectShowGrabber::getFormat().

◆ init

bool vpFrameGrabber::init

Set to true if the frame grabber has been initialized.

Definition at line 103 of file vpFrameGrabber.h.

◆ width

unsigned int vpFrameGrabber::width
protected

Number of columns in the image.

Definition at line 107 of file vpFrameGrabber.h.

Referenced by vpDirectShowGrabber::getFormat().

vpV4l2Grabber::setInput
void setInput(unsigned input=vpV4l2Grabber::DEFAULT_INPUT)
Definition: vpV4l2Grabber.cpp:372
vp1394TwoGrabber::setVideoMode
void setVideoMode(vp1394TwoVideoModeType videomode)
Definition: vp1394TwoGrabber.cpp:449
vpV4l2Grabber::setHeight
void setHeight(unsigned h)
Definition: vpV4l2Grabber.h:261
vp1394TwoGrabber::vpFRAMERATE_30
Definition: vp1394TwoGrabber.h:254
vpFrameGrabber::acquire
virtual void acquire(vpImage< unsigned char > &I)=0
vp1394TwoGrabber::vpVIDEO_MODE_320x240_YUV422
Definition: vp1394TwoGrabber.h:212
vpFrameGrabber
Base class for all video devices. It is designed to provide a front end to video sources.
Definition: vpFrameGrabber.h:100
vp1394TwoGrabber::setFramerate
void setFramerate(vp1394TwoFramerateType fps)
Definition: vp1394TwoGrabber.cpp:684
vpV4l2Grabber::setNBuffers
void setNBuffers(unsigned nbuffers)
Definition: vpV4l2Grabber.h:276
vpV4l2Grabber::framerate_50fps
50 frames per second
Definition: vpV4l2Grabber.h:149
vpV4l2Grabber::setWidth
void setWidth(unsigned w)
Definition: vpV4l2Grabber.h:256
vpV4l2Grabber::setFramerate
void setFramerate(vpV4l2FramerateType framerate)
Definition: vpV4l2Grabber.cpp:817
vpImageIo::write
static void write(const vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:374
vpFrameGrabber::open
virtual void open(vpImage< unsigned char > &I)=0
vp1394TwoGrabber
Class for firewire ieee1394 video devices using libdc1394-2.x api.
Definition: vp1394TwoGrabber.h:185
vpV4l2Grabber
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
Definition: vpV4l2Grabber.h:133
vpImage< unsigned char >