Visual Servoing Platform
version 3.6.1 under development (2024-11-21)
|
#include <visp3/sensor/vp1394CMUGrabber.h>
Public Types | |
enum | vpColorCodingType { YUV444 , YUV422 , YUV411 , RGB8 , MONO8 , MONO16 , UNKNOWN } |
Public Member Functions | |
vp1394CMUGrabber () | |
virtual | ~vp1394CMUGrabber () |
void | acquire (vpImage< unsigned char > &I) |
void | acquire (vpImage< vpRGBa > &I) |
void | close () |
void | displayCameraDescription (int cam_id) |
void | displayCameraModel () |
int | getFramerate () |
void | getGainMinMax (unsigned short &min, unsigned short &max) |
int | getNumberOfConnectedCameras () const |
void | getShutterMinMax (unsigned short &min, unsigned short &max) |
vpColorCodingType | getVideoColorCoding () const |
void | open (vpImage< unsigned char > &I) |
void | open (vpImage< vpRGBa > &I) |
vp1394CMUGrabber & | operator>> (vpImage< unsigned char > &I) |
vp1394CMUGrabber & | operator>> (vpImage< vpRGBa > &I) |
void | selectCamera (int cam_id) |
void | setAutoGain () |
void | setAutoShutter () |
void | setControl (unsigned short gain, unsigned short shutter) |
void | setFramerate (unsigned long fps) |
void | setShutter (unsigned short shutter) |
void | setGain (unsigned short gain) |
void | setVideoMode (unsigned long format, unsigned long mode) |
Public Attributes | |
bool | init |
Inherited functionalities from vpFramegrabber | |
unsigned int | getHeight () const |
unsigned int | getWidth () const |
unsigned int | height |
unsigned int | width |
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
Thus to be enabled, this class needs the optional CMU 1394 3rd party. Installation instruction are provided here https://visp.inria.fr/3rd_cmu1394.
This block is based on the CMU 1394 Digital Camera SDK. The CMU 1394 Digital Camera Driver must be installed (go to http://www.cs.cmu.edu/~iwan/1394/index.html to download it).
This first example available in tutorial-grabber-CMU1394.cpp shows how to grab and display images from a firewire camera under Windows.
This other example shows how to consider more than one firewire camera, and how to grab and display images from the first camera found on the bus.
Definition at line 155 of file vp1394CMUGrabber.h.
Enumeration of color codings.
Enumerator | |
---|---|
YUV444 | |
YUV422 | |
YUV411 | |
RGB8 | |
MONO8 | |
MONO16 | |
UNKNOWN |
Definition at line 161 of file vp1394CMUGrabber.h.
BEGIN_VISP_NAMESPACE vp1394CMUGrabber::vp1394CMUGrabber | ( | ) |
Basic constructor.
Definition at line 50 of file vp1394CMUGrabber.cpp.
References vpFrameGrabber::height, vpFrameGrabber::init, and vpFrameGrabber::width.
|
virtual |
|
virtual |
Grabs a grayscale image from the selected camera. If the camera color coding differs from vp1394CMUGrabber::MONO8, the acquired image is converted in a gray level image to match the requested format.
I | : Acquired gray level image. |
Implements vpFrameGrabber.
Definition at line 207 of file vp1394CMUGrabber.cpp.
References vpImage< Type >::bitmap, close(), vpImage< Type >::getSize(), MONO16, vpImageConvert::MONO16ToGrey(), MONO8, open(), vpFrameGrabberException::otherError, RGB8, vpImageConvert::RGBToGrey(), YUV411, vpImageConvert::YUV411ToGrey(), YUV422, vpImageConvert::YUV422ToGrey(), YUV444, and vpImageConvert::YUV444ToGrey().
Referenced by operator>>().
Grabs a color image from the selected camera. Since the cameras are not able to grab RGBa color coding format, the acquired image is converted in a RGBa to match the requested format. This transformation could be time consuming.
I | : Acquired color image in RGBa format. |
Implements vpFrameGrabber.
Definition at line 269 of file vp1394CMUGrabber.cpp.
References vpImage< Type >::bitmap, close(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImageConvert::GreyToRGBa(), MONO16, vpImageConvert::MONO16ToRGBa(), MONO8, open(), vpFrameGrabberException::otherError, RGB8, vpImageConvert::RGBToRGBa(), YUV411, vpImageConvert::YUV411ToRGBa(), YUV422, vpImageConvert::YUV422ToRGBa(), YUV444, and vpImageConvert::YUV444ToRGBa().
|
virtual |
Stop the acquisition of images and free the camera.
Implements vpFrameGrabber.
Definition at line 321 of file vp1394CMUGrabber.cpp.
References vpFrameGrabber::init, and vpFrameGrabberException::otherError.
Referenced by acquire(), selectCamera(), setFramerate(), setVideoMode(), and ~vp1394CMUGrabber().
void vp1394CMUGrabber::displayCameraDescription | ( | int | cam_id | ) |
Display information about the camera on the standard output.
Definition at line 486 of file vp1394CMUGrabber.cpp.
void vp1394CMUGrabber::displayCameraModel | ( | ) |
Display camera model on the standard output. Call it after open the grabber.
Definition at line 502 of file vp1394CMUGrabber.cpp.
int vp1394CMUGrabber::getFramerate | ( | ) |
Get the video framerate.
Value | Frame rate |
---|---|
0 | 1.875 fps |
1 | 3.75 fps |
2 | 7.5 fps |
3 | 15 fps |
4 | 30 fps |
5 | 60 fps |
6 | 120 fps |
7 | 240 fps |
Definition at line 707 of file vp1394CMUGrabber.cpp.
void vp1394CMUGrabber::getGainMinMax | ( | unsigned short & | min, |
unsigned short & | max | ||
) |
Get the gain min and max values.
Definition at line 363 of file vp1394CMUGrabber.cpp.
|
inherited |
Return the number of rows in the image.
Definition at line 38 of file vpFrameGrabber.cpp.
References vpFrameGrabber::height.
int vp1394CMUGrabber::getNumberOfConnectedCameras | ( | ) | const |
Get the number of connected cameras.
Definition at line 351 of file vp1394CMUGrabber.cpp.
void vp1394CMUGrabber::getShutterMinMax | ( | unsigned short & | min, |
unsigned short & | max | ||
) |
Get the shutter min and max values.
Definition at line 425 of file vp1394CMUGrabber.cpp.
|
inline |
Get the video color coding format.
Definition at line 218 of file vp1394CMUGrabber.h.
References MONO16, MONO8, RGB8, UNKNOWN, YUV411, YUV422, and YUV444.
Referenced by setVideoMode().
|
inherited |
Return the number of columns in the image.
Definition at line 43 of file vpFrameGrabber.cpp.
References vpFrameGrabber::width.
|
virtual |
Initialization of the grabber using a greyscale image.
I | : gray level image. |
Implements vpFrameGrabber.
Definition at line 184 of file vp1394CMUGrabber.cpp.
References vpFrameGrabber::height, vpImage< Type >::resize(), and vpFrameGrabber::width.
Referenced by acquire().
Initialization of the grabber using a color image.
I | : color image. |
Implements vpFrameGrabber.
Definition at line 194 of file vp1394CMUGrabber.cpp.
References vpFrameGrabber::height, vpImage< Type >::resize(), and vpFrameGrabber::width.
vp1394CMUGrabber & vp1394CMUGrabber::operator>> | ( | vpImage< unsigned char > & | I | ) |
Operator that allows to capture a grey level image.
I | : The captured image. |
Definition at line 734 of file vp1394CMUGrabber.cpp.
References acquire().
vp1394CMUGrabber & vp1394CMUGrabber::operator>> | ( | vpImage< vpRGBa > & | I | ) |
Operator that allows to capture a grey level image.
I | : The captured image. |
Definition at line 760 of file vp1394CMUGrabber.cpp.
References acquire().
void vp1394CMUGrabber::selectCamera | ( | int | cam_id | ) |
Select the camera on the bus from its index. The first camera found on the bus has index 0.
cam_id | : Camera index. |
Definition at line 82 of file vp1394CMUGrabber.cpp.
References close(), and vpFrameGrabberException::initializationError.
void vp1394CMUGrabber::setAutoGain | ( | ) |
Enable auto gain.
Definition at line 377 of file vp1394CMUGrabber.cpp.
void vp1394CMUGrabber::setAutoShutter | ( | ) |
Enable auto shutter.
Definition at line 440 of file vp1394CMUGrabber.cpp.
void vp1394CMUGrabber::setControl | ( | unsigned short | gain, |
unsigned short | shutter | ||
) |
Set the gain and the shutter values.
Definition at line 342 of file vp1394CMUGrabber.cpp.
References setGain(), and setShutter().
void vp1394CMUGrabber::setFramerate | ( | unsigned long | fps | ) |
Set camera framerate rate. This method has to be called before open().
fps | : Value between 0 to 7 used to select a specific camera framerate. See the following table for the correspondences between the input value and the framerate. |
Value | Frame rate |
---|---|
0 | 1.875 fps |
1 | 3.75 fps |
2 | 7.5 fps |
3 | 15 fps |
4 | 30 fps |
5 | 60 fps |
6 | 120 fps |
7 | 240 fps |
Definition at line 642 of file vp1394CMUGrabber.cpp.
References close(), vpFrameGrabberException::otherError, and vpFrameGrabberException::settingError.
void vp1394CMUGrabber::setGain | ( | unsigned short | gain | ) |
Disable auto gain and set the gain to the requested value.
Definition at line 387 of file vp1394CMUGrabber.cpp.
Referenced by setControl().
void vp1394CMUGrabber::setShutter | ( | unsigned short | shutter | ) |
Disable auto shutter and set the shutter to the requested value.
Definition at line 450 of file vp1394CMUGrabber.cpp.
Referenced by setControl().
void vp1394CMUGrabber::setVideoMode | ( | unsigned long | format, |
unsigned long | mode | ||
) |
Set the camera format and video mode. This method has to be called before open().
format | : Camera video format. |
mode | : Camera video mode. |
See the following table for the correspondences between the input format and mode and the resulting video color coding.
Format | Mode | (H) x (W) | Color |
---|---|---|---|
0 | 0 | 160 x 120 | YUV444 |
0 | 1 | 320 x 240 | YUV422 |
0 | 2 | 640 x 480 | YUV411 |
0 | 3 | 640 x 480 | YUV422 |
0 | 4 | 640 x 480 | RGB8 |
0 | 5 | 640 x 480 | MONO8 |
0 | 6 | 640 x 480 | MONO16 |
1 | 0 | 800 x 600 | YUV422 |
1 | 1 | 800 x 600 | RGB8 |
1 | 2 | 800 x 600 | MONO8 |
1 | 3 | 1024 x 768 | YUV422 |
1 | 4 | 1024 x 768 | RGB8 |
1 | 5 | 1024 x 768 | MONO8 |
1 | 6 | 800 x 600 | MONO16 |
1 | 7 | 1024 x 768 | MONO16 |
2 | 0 | 1280 x 960 | YUV422 |
2 | 1 | 1280 x 960 | RGB8 |
2 | 2 | 1280 x 960 | MONO8 |
2 | 3 | 1600 x 1200 | YUV422 |
2 | 4 | 1600 x 1200 | RGB8 |
2 | 5 | 1600 x 1200 | MONO8 |
2 | 6 | 1280 x 960 | MONO16 |
2 | 7 | 1600 x 1200 | MONO16 |
Definition at line 557 of file vp1394CMUGrabber.cpp.
References close(), getVideoColorCoding(), vpFrameGrabber::height, vpFrameGrabberException::otherError, vpFrameGrabberException::settingError, and vpFrameGrabber::width.
|
protectedinherited |
Number of rows in the image.
Definition at line 134 of file vpFrameGrabber.h.
Referenced by vpDiskGrabber::acquire(), vpPylonGrabberGigE::acquire(), vpPylonGrabberUsb::acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getHeight(), vp1394TwoGrabber::getHeight(), vpDiskGrabber::open(), open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), setVideoMode(), vp1394TwoGrabber::setVideoMode(), 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(), close(), vp1394TwoGrabber::close(), vpFlyCaptureGrabber::connect(), vpPylonGrabberGigE::connect(), vpPylonGrabberUsb::connect(), vpFlyCaptureGrabber::disconnect(), vpPylonGrabberGigE::disconnect(), vpPylonGrabberUsb::disconnect(), vpDiskGrabber::open(), vpV4l2Grabber::open(), vp1394TwoGrabber::resetBus(), vpFlyCaptureGrabber::startCapture(), vpPylonGrabberGigE::startCapture(), vpPylonGrabberUsb::startCapture(), vpFlyCaptureGrabber::stopCapture(), vpPylonGrabberGigE::stopCapture(), vpPylonGrabberUsb::stopCapture(), vp1394CMUGrabber(), vp1394TwoGrabber::vp1394TwoGrabber(), vpDiskGrabber::vpDiskGrabber(), and vpV4l2Grabber::vpV4l2Grabber().
|
protectedinherited |
Number of columns in the image.
Definition at line 135 of file vpFrameGrabber.h.
Referenced by vpDiskGrabber::acquire(), vpPylonGrabberGigE::acquire(), vpPylonGrabberUsb::acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getWidth(), vp1394TwoGrabber::getWidth(), vpDiskGrabber::open(), open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().