Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
vp1394TwoGrabber Class Reference

#include <visp3/sensor/vp1394TwoGrabber.h>

+ Inheritance diagram for vp1394TwoGrabber:

Public Types

enum  vp1394TwoIsoSpeedType {
  vpISO_SPEED_100 = DC1394_ISO_SPEED_100, vpISO_SPEED_200 = DC1394_ISO_SPEED_200, vpISO_SPEED_400 = DC1394_ISO_SPEED_400, vpISO_SPEED_800 = DC1394_ISO_SPEED_800,
  vpISO_SPEED_1600 = DC1394_ISO_SPEED_1600, vpISO_SPEED_3200 = DC1394_ISO_SPEED_3200
}
 
enum  vp1394TwoVideoModeType {
  vpVIDEO_MODE_160x120_YUV444 = DC1394_VIDEO_MODE_160x120_YUV444, vpVIDEO_MODE_320x240_YUV422 = DC1394_VIDEO_MODE_320x240_YUV422, vpVIDEO_MODE_640x480_YUV411 = DC1394_VIDEO_MODE_640x480_YUV411, vpVIDEO_MODE_640x480_YUV422 = DC1394_VIDEO_MODE_640x480_YUV422,
  vpVIDEO_MODE_640x480_RGB8 = DC1394_VIDEO_MODE_640x480_RGB8, vpVIDEO_MODE_640x480_MONO8 = DC1394_VIDEO_MODE_640x480_MONO8, vpVIDEO_MODE_640x480_MONO16 = DC1394_VIDEO_MODE_640x480_MONO16, vpVIDEO_MODE_800x600_YUV422 = DC1394_VIDEO_MODE_800x600_YUV422,
  vpVIDEO_MODE_800x600_RGB8 = DC1394_VIDEO_MODE_800x600_RGB8, vpVIDEO_MODE_800x600_MONO8 = DC1394_VIDEO_MODE_800x600_MONO8, vpVIDEO_MODE_1024x768_YUV422 = DC1394_VIDEO_MODE_1024x768_YUV422, vpVIDEO_MODE_1024x768_RGB8 = DC1394_VIDEO_MODE_1024x768_RGB8,
  vpVIDEO_MODE_1024x768_MONO8 = DC1394_VIDEO_MODE_1024x768_MONO8, vpVIDEO_MODE_800x600_MONO16 = DC1394_VIDEO_MODE_800x600_MONO16, vpVIDEO_MODE_1024x768_MONO16 = DC1394_VIDEO_MODE_1024x768_MONO16, vpVIDEO_MODE_1280x960_YUV422 = DC1394_VIDEO_MODE_1280x960_YUV422,
  vpVIDEO_MODE_1280x960_RGB8 = DC1394_VIDEO_MODE_1280x960_RGB8, vpVIDEO_MODE_1280x960_MONO8 = DC1394_VIDEO_MODE_1280x960_MONO8, vpVIDEO_MODE_1600x1200_YUV422 = DC1394_VIDEO_MODE_1600x1200_YUV422, vpVIDEO_MODE_1600x1200_RGB8 = DC1394_VIDEO_MODE_1600x1200_RGB8,
  vpVIDEO_MODE_1600x1200_MONO8 = DC1394_VIDEO_MODE_1600x1200_MONO8, vpVIDEO_MODE_1280x960_MONO16 = DC1394_VIDEO_MODE_1280x960_MONO16, vpVIDEO_MODE_1600x1200_MONO16 = DC1394_VIDEO_MODE_1600x1200_MONO16, vpVIDEO_MODE_EXIF = DC1394_VIDEO_MODE_EXIF,
  vpVIDEO_MODE_FORMAT7_0 = DC1394_VIDEO_MODE_FORMAT7_0, vpVIDEO_MODE_FORMAT7_1 = DC1394_VIDEO_MODE_FORMAT7_1, vpVIDEO_MODE_FORMAT7_2 = DC1394_VIDEO_MODE_FORMAT7_2, vpVIDEO_MODE_FORMAT7_3 = DC1394_VIDEO_MODE_FORMAT7_3,
  vpVIDEO_MODE_FORMAT7_4 = DC1394_VIDEO_MODE_FORMAT7_4, vpVIDEO_MODE_FORMAT7_5 = DC1394_VIDEO_MODE_FORMAT7_5, vpVIDEO_MODE_FORMAT7_6 = DC1394_VIDEO_MODE_FORMAT7_6, vpVIDEO_MODE_FORMAT7_7 = DC1394_VIDEO_MODE_FORMAT7_7
}
 
enum  vp1394TwoFramerateType {
  vpFRAMERATE_1_875 = DC1394_FRAMERATE_1_875, vpFRAMERATE_3_75 = DC1394_FRAMERATE_3_75, vpFRAMERATE_7_5 = DC1394_FRAMERATE_7_5, vpFRAMERATE_15 = DC1394_FRAMERATE_15,
  vpFRAMERATE_30 = DC1394_FRAMERATE_30, vpFRAMERATE_60 = DC1394_FRAMERATE_60, vpFRAMERATE_120 = DC1394_FRAMERATE_120, vpFRAMERATE_240 = DC1394_FRAMERATE_240
}
 
enum  vp1394TwoColorCodingType {
  vpCOLOR_CODING_MONO8 = DC1394_COLOR_CODING_MONO8, vpCOLOR_CODING_YUV411 = DC1394_COLOR_CODING_YUV411, vpCOLOR_CODING_YUV422 = DC1394_COLOR_CODING_YUV422, vpCOLOR_CODING_YUV444 = DC1394_COLOR_CODING_YUV444,
  vpCOLOR_CODING_RGB8 = DC1394_COLOR_CODING_RGB8, vpCOLOR_CODING_MONO16 = DC1394_COLOR_CODING_MONO16, vpCOLOR_CODING_RGB16 = DC1394_COLOR_CODING_RGB16, vpCOLOR_CODING_MONO16S = DC1394_COLOR_CODING_MONO16S,
  vpCOLOR_CODING_RGB16S = DC1394_COLOR_CODING_RGB16S, vpCOLOR_CODING_RAW8 = DC1394_COLOR_CODING_RAW8, vpCOLOR_CODING_RAW16 = DC1394_COLOR_CODING_RAW16
}
 
enum  vp1394TwoParametersType {
  vpFEATURE_BRIGHTNESS = DC1394_FEATURE_BRIGHTNESS, vpFEATURE_EXPOSURE = DC1394_FEATURE_EXPOSURE, vpFEATURE_SHARPNESS = DC1394_FEATURE_SHARPNESS, vpFEATURE_HUE = DC1394_FEATURE_HUE,
  vpFEATURE_SATURATION = DC1394_FEATURE_SATURATION, vpFEATURE_GAMMA = DC1394_FEATURE_GAMMA, vpFEATURE_SHUTTER = DC1394_FEATURE_SHUTTER, vpFEATURE_GAIN = DC1394_FEATURE_GAIN,
  vpFEATURE_IRIS = DC1394_FEATURE_IRIS
}
 

Public Member Functions

 vp1394TwoGrabber (bool reset=true)
 
virtual ~vp1394TwoGrabber ()
 
void acquire (vpImage< unsigned char > &I)
 
void acquire (vpImage< unsigned char > &I, uint64_t &timestamp, uint32_t &id)
 
void acquire (vpImage< vpRGBa > &I)
 
void acquire (vpImage< vpRGBa > &I, uint64_t &timestamp, uint32_t &id)
 
void close ()
 
dc1394video_frame_t * dequeue ()
 
dc1394video_frame_t * dequeue (vpImage< unsigned char > &I)
 
dc1394video_frame_t * dequeue (vpImage< unsigned char > &I, uint64_t &timestamp, uint32_t &id)
 
dc1394video_frame_t * dequeue (vpImage< vpRGBa > &I)
 
dc1394video_frame_t * dequeue (vpImage< vpRGBa > &I, uint64_t &timestamp, uint32_t &id)
 
void enqueue (dc1394video_frame_t *frame)
 
void getAutoGain (unsigned int &minvalue, unsigned int &maxvalue)
 
void getAutoShutter (unsigned int &minvalue, unsigned int &maxvalue)
 
uint64_t getCamera ()
 
void getCamera (uint64_t &camera)
 
void getColorCoding (vp1394TwoColorCodingType &coding)
 
uint32_t getColorCodingSupported (vp1394TwoVideoModeType videomode, std::list< vp1394TwoColorCodingType > &codings)
 
void getFramerate (vp1394TwoFramerateType &fps)
 
uint32_t getFramerateSupported (vp1394TwoVideoModeType videomode, std::list< vp1394TwoFramerateType > &fps)
 
uint64_t getGuid ()
 
void getGuid (uint64_t &guid)
 
void getHeight (unsigned int &height)
 
unsigned int getHeight ()
 
void getNumCameras (unsigned int &ncameras) const
 
unsigned int getNumCameras () const
 
unsigned int getParameterValue (vp1394TwoParametersType param)
 
unsigned int getRingBufferSize () const
 
void getVideoMode (vp1394TwoVideoModeType &videomode)
 
uint32_t getVideoModeSupported (std::list< vp1394TwoVideoModeType > &videomodes)
 
void getWidth (unsigned int &width)
 
unsigned int getWidth ()
 
bool isColor ()
 
bool isColorCodingSupported (vp1394TwoVideoModeType videomode, vp1394TwoColorCodingType coding)
 
bool isFramerateSupported (vp1394TwoVideoModeType videomode, vp1394TwoFramerateType fps)
 
bool isVideoModeSupported (vp1394TwoVideoModeType videomode)
 
bool isVideoModeFormat7 (vp1394TwoVideoModeType videomode)
 
void open (vpImage< unsigned char > &I)
 
void open (vpImage< vpRGBa > &I)
 
vp1394TwoGrabberoperator>> (vpImage< unsigned char > &I)
 
vp1394TwoGrabberoperator>> (vpImage< vpRGBa > &I)
 
void printCameraInfo ()
 
void resetBus ()
 
void setAutoGain (bool enable=true)
 
void setAutoGain (unsigned int minvalue, unsigned int maxvalue)
 
void setAutoShutter (bool enable=true)
 
void setAutoShutter (unsigned int minvalue, unsigned int maxvalue)
 
void setCamera (uint64_t camera)
 
void setColorCoding (vp1394TwoColorCodingType coding)
 
void setFormat7ROI (unsigned int left=0, unsigned int top=0, unsigned int width=0, unsigned int height=0)
 
void setFramerate (vp1394TwoFramerateType fps)
 
void setIsoTransmissionSpeed (vp1394TwoIsoSpeedType isospeed)
 
void setPanControl (unsigned int panControlValue)
 
void setParameterValue (vp1394TwoParametersType param, unsigned int val)
 
void setRingBufferSize (unsigned int size)
 
void setVideoMode (vp1394TwoVideoModeType videomode)
 
Inherited functionalities from vpFramegrabber
unsigned int getHeight () const
 
unsigned int getWidth () const
 

Static Public Member Functions

static std::string colorCoding2string (vp1394TwoColorCodingType colorcoding)
 
static std::string framerate2string (vp1394TwoFramerateType fps)
 
static vp1394TwoVideoModeType string2videoMode (std::string videomode)
 
static vp1394TwoFramerateType string2framerate (std::string fps)
 
static vp1394TwoColorCodingType string2colorCoding (std::string colorcoding)
 
static std::string videoMode2string (vp1394TwoVideoModeType videomode)
 

Public Attributes

bool init
 

Static Public Attributes

static const char * strVideoMode [DC1394_VIDEO_MODE_NUM]
 
static const char * strFramerate [DC1394_FRAMERATE_NUM]
 
static const char * strColorCoding [DC1394_COLOR_CODING_NUM]
 

Protected Attributes

unsigned int height
 
unsigned int width
 

Detailed Description

Class for firewire ieee1394 video devices using libdc1394-2.x api.

Needs libraw1394-1.2.0 and libdc1394-2.0.0 or more recent versions available on http://sourceforge.net.

This class was tested with Marlin F033C and F131B cameras and with Point Grey Dragonfly 2, Flea 2 and Flea 3 cameras.

This grabber allows single or multi camera acquisition.

  • Here you will find an example of single capture from the first camera found on the bus. This example is available in tutorial-grabber-1394.cpp:
    #include <visp3/core/vpImage.h>
    #include <visp3/gui/vpDisplayX.h>
    #include <visp3/gui/vpDisplayOpenCV.h>
    #include <visp3/sensor/vp1394TwoGrabber.h>
    #include "record_helper.h"
    int main(int argc, char **argv)
    {
    #ifdef VISP_HAVE_DC1394
    try {
    std::string opt_seqname;
    int opt_record_mode = 0;
    bool opt_change_settings = false;
    for (int i = 0; i < argc; i++) {
    if (std::string(argv[i]) == "--seqname")
    opt_seqname = std::string(argv[i + 1]);
    else if (std::string(argv[i]) == "--record")
    opt_record_mode = std::atoi(argv[i + 1]);
    else if (std::string(argv[i]) == "--change_settings")
    opt_change_settings = true;
    else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
    std::cout << "\nUsage: " << argv[0]
    << " [--seqname <sequence name (default: empty>] [--record <0: continuous | 1: single shot (default: 0)>]"
    " [--change_settings] [--help] [-h]\n"
    << "\nExample to visualize images:\n"
    << " " << argv[0] << "\n"
    << "\nExamples to record a sequence:\n"
    << " " << argv[0] << " --seqname I%04d.png \n"
    << " " << argv[0] << " --seqname folder/I%04d.png --record 0\n"
    << "\nExamples to record single shot images:\n"
    << " " << argv[0] << " --seqname I%04d.png --record 1\n"
    << " " << argv[0] << " --seqname folder/I%04d.png --record 1\n"
    << std::endl;
    return 0;
    }
    }
    std::cout << "Settings : " << (opt_change_settings ? "modified" : "current") << std::endl;
    std::cout << "Recording : " << (opt_seqname.empty() ? "disabled" : "enabled") << std::endl;
    std::string text_record_mode = std::string("Record mode: ") + (opt_record_mode ? std::string("single") : std::string("continuous"));
    if (! opt_seqname.empty()) {
    std::cout << text_record_mode << std::endl;
    std::cout << "Record name: " << opt_seqname << std::endl;
    }
    vpImage<unsigned char> I; // Create a gray level image container
    bool reset = false; // Disable bus reset during construction (default)
    vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib
    if (opt_change_settings) {
    try {
    }
    catch(...) { // If settings are not available just catch execption to
    // continue with default settings
    std::cout << "Warning: cannot modify camera settings" << std::endl;
    }
    }
    g.open(I);
    std::cout << "Image size : " << I.getWidth() << " " << I.getHeight() << std::endl;
    #ifdef VISP_HAVE_X11
    vpDisplayX d(I);
    #elif defined(VISP_HAVE_OPENCV)
    #else
    std::cout << "No image viewer is available..." << std::endl;
    #endif
    bool quit = false;
    while (! quit) {
    double t = vpTime::measureTimeMs();
    g.acquire(I);
    quit = record_helper(opt_seqname, opt_record_mode, I);
    std::stringstream ss;
    ss << "Acquisition time: " << std::setprecision(3) << vpTime::measureTimeMs() - t << " ms";
    vpDisplay::displayText(I, I.getHeight() - 20, 10, ss.str(), vpColor::red);
    }
    } catch (const vpException &e) {
    std::cout << "Catch an exception: " << e << std::endl;
    }
    #else
    (void) argc;
    (void) argv;
    std::cout << "Install libdc1394, configure and build ViSP again to use this example" << std::endl;
    #endif
    }
    A line by line explanation of this example is provided in Tutorial: Image frame grabbing. An other example that shows how to use format 7 and the auto-shutter is provided in vp1394TwoGrabber() constructor:
  • If more than one camera is connected, it is also possible to select a specific camera by its GUID:
    #include <visp3/core/vpConfig.h>
    #include <visp3/core/vpImage.h>
    #include <visp3/io/vpImageIo.h>
    #include <visp3/sensor/vp1394TwoGrabber.h>
    int main()
    {
    #if defined(VISP_HAVE_DC1394)
    vpImage<unsigned char> I; // Create a gray level image container
    bool reset = false; // Disable bus reset during construction
    vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib
    unsigned int ncameras; // Number of cameras on the bus
    ncameras = g.getNumCameras();
    std::cout << ncameras << " cameras found:" << std::endl;
    for(unsigned int i=0; i< ncameras; i++)
    {
    g.setCamera(i);
    uint64_t guid = g.getGuid();
    printf("camera %d with guid 0x%lx\n", i, (long unsigned int)guid);
    }
    // produce:
    // 2 cameras found:
    // camera 0 with guid 0xb09d01009b329c
    // camera 1 with guid 0xb09d01007e0ee7
    g.setCamera( (uint64_t)0xb09d01009b329cULL );
    printf("Use camera with GUID: 0x%lx\n", (long unsigned int)g.getGuid());
    g.acquire(I); // Acquire an image from the camera with GUID 0xb09d01009b329c
    vpImageIo::write(I, "image.pgm"); // Write image on the disk
    #endif
    }
  • Here an example of multi camera capture. An other example is available in setCamera():
    #include <visp3/core/vpConfig.h>
    #include <visp3/core/vpImage.h>
    #include <visp3/io/vpImageIo.h>
    #include <visp3/sensor/vp1394TwoGrabber.h>
    int main()
    {
    #if defined(VISP_HAVE_DC1394)
    bool reset = false; // Disable bus reset during construction
    vp1394TwoGrabber g(reset); // Creation of a grabber instance based on libdc1394-2.x third party lib.
    unsigned int ncameras; // Number of cameras on the bus
    ncameras = g.getNumCameras();
    // Create an image container for each camera
    char filename[FILENAME_MAX];
    // If the first camera supports vpVIDEO_MODE_640x480_YUV422 video mode
    g.setCamera(0);
    // If the second camera support 30 fps acquisition
    g.setCamera(1);
    // Acquire an image from each camera
    for (unsigned int camera=0; camera < ncameras; camera ++) {
    g.setCamera(camera);
    g.acquire(I[camera]);
    sprintf(filename, "image-cam%d.pgm", camera);
    vpImageIo::write(I[camera], filename);
    }
    delete [] I;
    #endif
    }
Author
Fabien Spindler (Fabie.nosp@m.n.Sp.nosp@m.indle.nosp@m.r@ir.nosp@m.isa.f.nosp@m.r), Irisa / Inria Rennes
Examples:
grab1394Two.cpp, HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, SickLDMRS-Process.cpp, test1394TwoGrabber.cpp, test1394TwoResetBus.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-apriltag-detector-live.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-mb-generic-tracker-live.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, and tutorial-pose-from-points-live.cpp.

Definition at line 186 of file vp1394TwoGrabber.h.

Member Enumeration Documentation

Enumeration of color codings. See libdc1394 2.x header file dc1394/control.h

Enumerator
vpCOLOR_CODING_MONO8 
vpCOLOR_CODING_YUV411 
vpCOLOR_CODING_YUV422 
vpCOLOR_CODING_YUV444 
vpCOLOR_CODING_RGB8 
vpCOLOR_CODING_MONO16 
vpCOLOR_CODING_RGB16 
vpCOLOR_CODING_MONO16S 
vpCOLOR_CODING_RGB16S 
vpCOLOR_CODING_RAW8 
vpCOLOR_CODING_RAW16 
Examples:
grab1394Two.cpp.

Definition at line 265 of file vp1394TwoGrabber.h.

Enumeration of framerates. See libdc1394 2.x header file dc1394/control.h

Enumerator
vpFRAMERATE_1_875 
vpFRAMERATE_3_75 
vpFRAMERATE_7_5 
vpFRAMERATE_15 
vpFRAMERATE_30 
vpFRAMERATE_60 
vpFRAMERATE_120 
vpFRAMERATE_240 
Examples:
grab1394Two.cpp.

Definition at line 250 of file vp1394TwoGrabber.h.

Enumeration of iso speed. See libdc1394 2.x header file dc1394/control.h

Enumerator
vpISO_SPEED_100 
vpISO_SPEED_200 
vpISO_SPEED_400 
vpISO_SPEED_800 
vpISO_SPEED_1600 
vpISO_SPEED_3200 

Definition at line 198 of file vp1394TwoGrabber.h.

Enumeration of the parameters that can be modified. See libdc1394 2.x header file dc1394/control.h

Enumerator
vpFEATURE_BRIGHTNESS 
vpFEATURE_EXPOSURE 
vpFEATURE_SHARPNESS 
vpFEATURE_HUE 
vpFEATURE_SATURATION 
vpFEATURE_GAMMA 
vpFEATURE_SHUTTER 
vpFEATURE_GAIN 
vpFEATURE_IRIS 

Definition at line 283 of file vp1394TwoGrabber.h.

Enumeration of video modes. See libdc1394 2.x header file dc1394/control.h

Enumerator
vpVIDEO_MODE_160x120_YUV444 
vpVIDEO_MODE_320x240_YUV422 
vpVIDEO_MODE_640x480_YUV411 
vpVIDEO_MODE_640x480_YUV422 
vpVIDEO_MODE_640x480_RGB8 
vpVIDEO_MODE_640x480_MONO8 
vpVIDEO_MODE_640x480_MONO16 
vpVIDEO_MODE_800x600_YUV422 
vpVIDEO_MODE_800x600_RGB8 
vpVIDEO_MODE_800x600_MONO8 
vpVIDEO_MODE_1024x768_YUV422 
vpVIDEO_MODE_1024x768_RGB8 
vpVIDEO_MODE_1024x768_MONO8 
vpVIDEO_MODE_800x600_MONO16 
vpVIDEO_MODE_1024x768_MONO16 
vpVIDEO_MODE_1280x960_YUV422 
vpVIDEO_MODE_1280x960_RGB8 
vpVIDEO_MODE_1280x960_MONO8 
vpVIDEO_MODE_1600x1200_YUV422 
vpVIDEO_MODE_1600x1200_RGB8 
vpVIDEO_MODE_1600x1200_MONO8 
vpVIDEO_MODE_1280x960_MONO16 
vpVIDEO_MODE_1600x1200_MONO16 
vpVIDEO_MODE_EXIF 
vpVIDEO_MODE_FORMAT7_0 
vpVIDEO_MODE_FORMAT7_1 
vpVIDEO_MODE_FORMAT7_2 
vpVIDEO_MODE_FORMAT7_3 
vpVIDEO_MODE_FORMAT7_4 
vpVIDEO_MODE_FORMAT7_5 
vpVIDEO_MODE_FORMAT7_6 
vpVIDEO_MODE_FORMAT7_7 
Examples:
grab1394Two.cpp.

Definition at line 211 of file vp1394TwoGrabber.h.

Constructor & Destructor Documentation

vp1394TwoGrabber::vp1394TwoGrabber ( bool  reset = true)
explicit

Default constructor.

By default:

  • the camera is the first found on the bus,
  • the ring buffer size is set to 4,
  • reset the bus attached to the first camera found on the bus.

Current camera settings can be changed using setCamera() to select the active camera on the bus and than setVideoMode() or setFramerate() to fix the active camera settings. The list of supported video modes and framerates is available using respectively getVideoModeSupported() and getFramerateSupported(). To change the ring buffer size use setRingBufferSize().

Parameters
reset: If "true", reset the bus attached to the first camera found. Bus reset may help to make firewire working if the program was not properly stopped by a CTRL-C.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(1600*20-1, 1600*20); // Set shutter min and max values
g.setIsoTransmissionSpeed(vp1394TwoGrabber::vpISO_SPEED_800); // 1394b
while(1)
g.acquire(I);
#endif
}
See also
setCamera(), setVideoMode(), setFramerate()

Definition at line 124 of file vp1394TwoGrabber.cpp.

References vpFrameGrabber::height, vpFrameGrabber::init, and vpFrameGrabber::width.

vp1394TwoGrabber::~vp1394TwoGrabber ( )
virtual

Destructor.

Close the firewire grabber.

See also
close()

Definition at line 154 of file vp1394TwoGrabber.cpp.

References close().

Member Function Documentation

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

Acquire a grey level image from the active camera.

Parameters
I: Image data structure (8 bits image).
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus or if can't get camera settings.
vpFrameGrabberException::otherError: If format conversion to return a 8 bits image is not implemented.
See also
setCamera(), setVideoMode(), setFramerate(), dequeue(), enqueue()

Implements vpFrameGrabber.

Examples:
HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, SickLDMRS-Process.cpp, test1394TwoGrabber.cpp, test1394TwoResetBus.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-grabber-1394-writer.cpp, and tutorial-grabber-1394.cpp.

Definition at line 2507 of file vp1394TwoGrabber.cpp.

References dequeue(), and enqueue().

Referenced by open(), and operator>>().

void vp1394TwoGrabber::acquire ( vpImage< unsigned char > &  I,
uint64_t &  timestamp,
uint32_t &  id 
)

Acquire a grey level image from the active camera.

Parameters
I: Image data structure (8 bits image).
timestamp: The unix time in microseconds at which the frame was captured in the ring buffer.
id: The frame position in the ring buffer.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus or if can't get camera settings.
vpFrameGrabberException::otherError: If format conversion to return a 8 bits image is not implemented.
See also
setCamera(), setVideoMode(), setFramerate(), dequeue(), enqueue()

Definition at line 2536 of file vp1394TwoGrabber.cpp.

References dequeue(), enqueue(), and open().

void vp1394TwoGrabber::acquire ( vpImage< vpRGBa > &  I)
virtual

Acquire a color image from the active camera.

Parameters
I: Image data structure (32 bits RGBa image).
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::otherError: If format conversion to return a RGBa bits image is not implemented.
See also
setCamera(), setVideoMode(), setFramerate(), dequeue(), enqueue()

Implements vpFrameGrabber.

Definition at line 2558 of file vp1394TwoGrabber.cpp.

References dequeue(), enqueue(), and open().

void vp1394TwoGrabber::acquire ( vpImage< vpRGBa > &  I,
uint64_t &  timestamp,
uint32_t &  id 
)

Acquire a color image from the active camera.

Parameters
I: Image data structure (32 bits RGBa image).
timestamp: The unix time in microseconds at which the frame was captured in the ring buffer.
id: The frame position in the ring buffer.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::otherError: If format conversion to return a RGBa bits image is not implemented.
See also
setCamera(), setVideoMode(), setFramerate(), dequeue(), enqueue()

Definition at line 2587 of file vp1394TwoGrabber.cpp.

References vpImage< Type >::bitmap, close(), dequeue(), enqueue(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImageConvert::GreyToRGBa(), vpFrameGrabber::height, open(), vpFrameGrabberException::otherError, vpImage< Type >::resize(), vpImageConvert::RGBToRGBa(), vpERROR_TRACE, vpFrameGrabber::width, vpImageConvert::YUV411ToRGBa(), vpImageConvert::YUV422ToRGBa(), and vpImageConvert::YUV444ToRGBa().

std::string vp1394TwoGrabber::colorCoding2string ( vp1394TwoColorCodingType  colorcoding)
static

Converts the color coding identifier into a string containing the description of the color coding.

Parameters
colorcoding: The color coding format.
Returns
A string describing the color coding, an empty string if the color coding is not supported.
See also
string2colorCoding()
Examples:
grab1394Two.cpp.

Definition at line 2849 of file vp1394TwoGrabber.cpp.

References strColorCoding, and vpCERROR.

Referenced by string2colorCoding().

dc1394video_frame_t * vp1394TwoGrabber::dequeue ( )

Get an image from the active camera frame buffer. This buffer neads to be released by enqueue().

Returns
Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images. The dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
dc1394video_frame_t *frame;
while(1) {
frame = g.dequeue();
// Current image is now in frame structure
// Do your stuff
g.enqueue(frame);
}
#endif
}
See also
enqueue()
Examples:
servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DCamVelocityKalman.cpp, and SickLDMRS-Process.cpp.

Definition at line 2137 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

Referenced by acquire(), and dequeue().

dc1394video_frame_t * vp1394TwoGrabber::dequeue ( vpImage< unsigned char > &  I)

Get an image from the active camera frame buffer. This buffer neads to be released by enqueue().

Parameters
I: Image data structure (8 bits image).
Returns
Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images. The dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
dc1394video_frame_t *frame;
while(1) {
frame = g.dequeue(I);
// Current image is now in frame structure and in I
// Do your stuff
g.enqueue(frame);
}
#endif
}
See also
enqueue()

Definition at line 2196 of file vp1394TwoGrabber.cpp.

References dequeue().

dc1394video_frame_t * vp1394TwoGrabber::dequeue ( vpImage< unsigned char > &  I,
uint64_t &  timestamp,
uint32_t &  id 
)

Get an image from the active camera frame buffer. This buffer neads to be released by enqueue().

Parameters
I: Image data structure (8 bits image).
timestamp: The unix time in microseconds at which the frame was captured in the ring buffer.
id: The frame position in the ring buffer.
Returns
Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images. The dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
dc1394video_frame_t *frame;
uint64_t timestamp_us; // timestamp in us
uint32_t id;
while(1) {
frame = g.dequeue(I, timestamp_us, id); // get the last image
// Current image is now in frame structure and in I
// Do your stuff
g.enqueue(frame);
}
#endif
}
See also
enqueue()

Definition at line 2256 of file vp1394TwoGrabber.cpp.

References vpImage< Type >::bitmap, close(), dequeue(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpFrameGrabber::height, vpImageConvert::MONO16ToGrey(), open(), vpFrameGrabberException::otherError, vpImage< Type >::resize(), vpImageConvert::RGBToGrey(), vpERROR_TRACE, vpFrameGrabber::width, vpImageConvert::YUV411ToGrey(), vpImageConvert::YUV422ToGrey(), and vpImageConvert::YUV444ToGrey().

dc1394video_frame_t * vp1394TwoGrabber::dequeue ( vpImage< vpRGBa > &  I)

Get an image from the active camera frame buffer. This buffer neads to be released by enqueue().

Parameters
I: Image data structure (32 bits RGBa image).
Returns
Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab color images. The dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
dc1394video_frame_t *frame;
while(1) {
frame = g.dequeue(I);
// Current image is now in frame structure and in I
// Do your stuff
g.enqueue(frame);
}
#endif
}
See also
enqueue()

Definition at line 2353 of file vp1394TwoGrabber.cpp.

References dequeue().

dc1394video_frame_t * vp1394TwoGrabber::dequeue ( vpImage< vpRGBa > &  I,
uint64_t &  timestamp,
uint32_t &  id 
)

Get an image from the active camera frame buffer. This buffer neads to be released by enqueue().

Parameters
I: Image data structure (32 bits RGBa image).
timestamp: The unix time in microseconds at which the frame was captured in the ring buffer.
id: The frame position in the ring buffer.
Returns
Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab color images. The dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
dc1394video_frame_t *frame;
uint64_t timestamp_us; // timestamp in us
uint32_t id;
while(1) {
frame = g.dequeue(I, timestamp_us, id); // get the last image
// Current image is now in frame structure and in I
// Do your stuff
g.enqueue(frame);
}
#endif
}
See also
enqueue()

Definition at line 2413 of file vp1394TwoGrabber.cpp.

References vpImage< Type >::bitmap, close(), dequeue(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpImageConvert::GreyToRGBa(), vpFrameGrabber::height, vpImageConvert::MONO16ToRGBa(), open(), vpFrameGrabberException::otherError, vpImage< Type >::resize(), vpImageConvert::RGBToRGBa(), vpERROR_TRACE, vpFrameGrabber::width, vpImageConvert::YUV411ToRGBa(), vpImageConvert::YUV422ToRGBa(), and vpImageConvert::YUV444ToRGBa().

void vp1394TwoGrabber::enqueue ( dc1394video_frame_t *  frame)

Release the frame buffer used by the active camera.

Parameters
frame: Pointer to the libdc1394-2.x image data structure.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
See also
dequeue()
Examples:
servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DCamVelocityKalman.cpp, and SickLDMRS-Process.cpp.

Definition at line 2481 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

Referenced by acquire().

std::string vp1394TwoGrabber::framerate2string ( vp1394TwoFramerateType  fps)
static

Converts the framerate identifier into a string containing the description of the framerate.

Parameters
fps: The camera capture framerate.
Returns
A string describing the framerate, an empty string if the framerate is not supported.
See also
string2framerate()
Examples:
grab1394Two.cpp.

Definition at line 2823 of file vp1394TwoGrabber.cpp.

References strFramerate, and vpCERROR.

Referenced by string2framerate().

void vp1394TwoGrabber::getAutoGain ( unsigned int &  minvalue,
unsigned int &  maxvalue 
)

Get auto gain min and max values.

Warning
Getting min and max auto gain values is only available for AVT cameras.
Parameters
minvalue: Min gain.
maxvalue: Max gain.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Definition at line 1857 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394TwoGrabber::getAutoShutter ( unsigned int &  minvalue,
unsigned int &  maxvalue 
)

Get auto shutter min and max values.

Warning
Getting min and max auto shutter values is only available for AVT cameras.
Parameters
minvalue: Min shutter exposure time.
maxvalue: Max shutter exposure time.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Definition at line 1711 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

uint64_t vp1394TwoGrabber::getCamera ( )

Get the active camera identifier on the bus.

Returns
The active camera identifier. The value is comprised between 0 (the first camera) and the number of cameras found on the bus returned by getNumCameras() minus 1.
Exceptions
vpFrameGrabberException::initializationError: If no camera is found.
See also
setCamera(), getNumCameras()

Definition at line 358 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

void vp1394TwoGrabber::getCamera ( uint64_t &  cam_id)

Get the active camera identifier on the bus.

Parameters
cam_id: The active camera identifier. The value is comprised between 0 (the first camera) and the number of cameras found on the bus returned by getNumCameras() minus 1.
Exceptions
vpFrameGrabberException::initializationError: If no camera is found.
See also
setCamera(), getNumCameras()

Definition at line 333 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

void vp1394TwoGrabber::getColorCoding ( vp1394TwoColorCodingType coding)

Query the actual color coding of the active camera. The camera supported color codings are given by getColorCodingSupported().

Parameters
coding: The camera capture color coding.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the actual color coding. Occurs if current video mode is vp1394TwoGrabber::vpVIDEO_MODE_EXIF (format 6).
See also
setColorCoding(), getColorCodingSupported(), setCamera()

Definition at line 1000 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by isColor().

uint32_t vp1394TwoGrabber::getColorCodingSupported ( vp1394TwoVideoModeType  mode,
std::list< vp1394TwoColorCodingType > &  codings 
)

Query the available color codings for the given camera video mode (see file dc1394/control.h).

Parameters
mode: Camera video mode.
codings: The list of supported color codings for the given camera video mode.
Returns
The number of supported color codings, 0 if no color codings is available.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the color codingss.
See also
setColorCoding(), getColorCoding(), setCamera()

Definition at line 1058 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394TwoGrabber::getFramerate ( vp1394TwoFramerateType fps)

Query the actual camera framerate of the active camera. The camera supported framerates are given by getFramerateSupported().

Parameters
fps: The camera capture framerate.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the framerate.
See also
setFramerate(), getFramerateSupported(), setCamera()
Examples:
servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 733 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

uint32_t vp1394TwoGrabber::getFramerateSupported ( vp1394TwoVideoModeType  mode,
std::list< vp1394TwoFramerateType > &  fps 
)

Query the available framerates for the given camera video mode (see file dc1394/control.h). No framerate is associated to the following camera modes :

Parameters
mode: Camera video mode.
fps: The list of supported camera framerates for the given camera video mode.
Returns
The number of supported framerates, 0 if no framerate is available.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the supported framerates.
See also
setFramerate(), getFramerate(), setCamera()

Definition at line 781 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, vpERROR_TRACE, vpVIDEO_MODE_EXIF, vpVIDEO_MODE_FORMAT7_0, vpVIDEO_MODE_FORMAT7_1, vpVIDEO_MODE_FORMAT7_2, vpVIDEO_MODE_FORMAT7_3, vpVIDEO_MODE_FORMAT7_4, vpVIDEO_MODE_FORMAT7_5, vpVIDEO_MODE_FORMAT7_6, and vpVIDEO_MODE_FORMAT7_7.

void vp1394TwoGrabber::getGuid ( uint64_t &  guid)

Query the actual camera GUID.

See also
setCamera(), getCamera()

Definition at line 3304 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

unsigned int vpFrameGrabber::getHeight ( ) const
inlineinherited

Return the number of rows in the image.

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

Definition at line 114 of file vpFrameGrabber.h.

void vp1394TwoGrabber::getHeight ( unsigned int &  h)

Get the image height. It depends on the camera vide mode setVideoMode(). The image size is only available after a call to open() or acquire().

Parameters
h: The image height.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
Warning
Has to be called after open() or acquire() to be sure that camera settings are send to the camera.
See also
getWidth()

Definition at line 2709 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabber::height, vpFrameGrabberException::initializationError, and vpERROR_TRACE.

unsigned int vp1394TwoGrabber::getHeight ( )

Get the image height. It depends on the camera vide mode setVideoMode(). The image size is only available after a call to open() or acquire().

Returns
The image height.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
Warning
Has to be called after open() or acquire() to be sure that camera settings are send to the camera.
See also
getWidth()

Definition at line 2736 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabber::height, vpFrameGrabberException::initializationError, and vpERROR_TRACE.

void vp1394TwoGrabber::getNumCameras ( unsigned int &  ncameras) const

Return the number of cameras connected on the bus.

Parameters
ncameras: The number of cameras found on the bus.
Examples:
manGrab1394-2.cpp, SickLDMRS-Process.cpp, and test1394TwoGrabber.cpp.

Definition at line 376 of file vp1394TwoGrabber.cpp.

References vpCTRACE.

unsigned int vp1394TwoGrabber::getNumCameras ( ) const

Return the number of cameras connected on the bus.

Returns
The number of cameras found on the bus.

Definition at line 393 of file vp1394TwoGrabber.cpp.

References vpCTRACE.

unsigned int vp1394TwoGrabber::getParameterValue ( vp1394TwoParametersType  param)

This method get the value of one of the parameters of the camera.

Parameters
param: The parameter expressing the value to return
Returns
the parameter's value
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: if the parameter cannot be retrieved.
See also
setParameterValue()

Definition at line 3109 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, vpERROR_TRACE, vpFEATURE_BRIGHTNESS, vpFEATURE_EXPOSURE, vpFEATURE_GAIN, vpFEATURE_GAMMA, vpFEATURE_HUE, vpFEATURE_IRIS, vpFEATURE_SATURATION, vpFEATURE_SHARPNESS, and vpFEATURE_SHUTTER.

Referenced by getGuid().

unsigned int vp1394TwoGrabber::getRingBufferSize ( ) const

Get the current ring buffer size used for the capture. To change the ring buffer size see setRingBufferSize().

Returns
Current ring buffer size.
See also
setRingBufferSize()

Definition at line 1579 of file vp1394TwoGrabber.cpp.

void vp1394TwoGrabber::getVideoMode ( vp1394TwoVideoModeType videomode)

Query the actual capture video mode of the active camera. All the active camera supported modes are given by getVideoModeSupported().

Parameters
videomode: The camera capture video mode.
Exceptions
vpFrameGrabberException::initializationError: If the required camera is not present.
vpFrameGrabberException::settingError: If we can't get the camera actual video mode.
See also
setVideoMode(), getVideoModeSupported(), setCamera()

Definition at line 498 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by setFramerate().

uint32_t vp1394TwoGrabber::getVideoModeSupported ( std::list< vp1394TwoVideoModeType > &  videomodes)

Query the available active camera video modes.

Parameters
videomodes: The list of supported camera video modes.
Returns
The number of supported camera modes, 0 if an error occurs.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get video modes.
See also
setVideoMode(), getVideoMode(), getCamera()

Definition at line 533 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

unsigned int vpFrameGrabber::getWidth ( ) const
inlineinherited

Return the number of columns in the image.

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

Definition at line 116 of file vpFrameGrabber.h.

void vp1394TwoGrabber::getWidth ( unsigned int &  w)

Get the image width. It depends on the camera video mode setVideoMode(). The image size is only available after a call to open() or acquire().

Parameters
w: The image width, zero if the required camera is not available.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
Warning
Has to be called after open() or acquire() to be sure that camera settings are send to the camera.
See also
getHeight(), open(), acquire()

Definition at line 2653 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpERROR_TRACE, and vpFrameGrabber::width.

unsigned int vp1394TwoGrabber::getWidth ( )

Get the image width. It depends on the camera video mode setVideoMode(). The image size is only available after a call to open() or acquire().

Returns
width : The image width, zero if the required camera is not available.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
Warning
Has to be called after open() or acquire() to be sure that camera settings are send to the camera.
See also
getHeight(), open(), acquire()

Definition at line 2681 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpERROR_TRACE, and vpFrameGrabber::width.

bool vp1394TwoGrabber::isColor ( )

Indicates if the active camera is grabbing color or grey images.

We consider color images if the color coding is either YUV (411, 422, 444) or RGB (8, 16, 16S). We consider grey images if the color coding is MONO (8, 16, 16S) or RAW (8, 16). vp1394TwoColorCodingType gives the supported color codings.

Returns
true : If color images are acquired.
false : If grey images are acquired.
See also
getColorCoding(), setCamera()

Definition at line 638 of file vp1394TwoGrabber.cpp.

References getColorCoding(), vpCOLOR_CODING_MONO16, vpCOLOR_CODING_MONO16S, vpCOLOR_CODING_MONO8, vpCOLOR_CODING_RAW16, vpCOLOR_CODING_RAW8, vpCOLOR_CODING_RGB16, vpCOLOR_CODING_RGB16S, vpCOLOR_CODING_RGB8, vpCOLOR_CODING_YUV411, vpCOLOR_CODING_YUV422, and vpCOLOR_CODING_YUV444.

bool vp1394TwoGrabber::isColorCodingSupported ( vp1394TwoVideoModeType  mode,
vp1394TwoColorCodingType  coding 
)

Check if the color coding is supported for the given camera video mode (see file dc1394/control.h).

Parameters
mode: Camera video mode.
coding: Desired color coding for the given camera video mode.
Returns
true if the color coding is supported.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the color codingss.
vpFrameGrabberException::settingError: If the color coding is not supported.
See also
setColorCoding(), getColorCoding(), setCamera()

Definition at line 1121 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by setColorCoding().

bool vp1394TwoGrabber::isFramerateSupported ( vp1394TwoVideoModeType  mode,
vp1394TwoFramerateType  fps 
)

Check if the desired framerate is supported for the given camera video mode (see file dc1394/control.h). No framerate is associated to the following camera modes :

Parameters
mode: Camera video mode.
fps: The desired camera framerates for the given camera video mode.
Returns
true if the desired framerate is supported by the active camera.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get the supported framerates.
vpFrameGrabberException::settingError: If the framerate is not supported.
See also
setFramerate(), getFramerate(), setCamera()

Definition at line 857 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, vpERROR_TRACE, vpVIDEO_MODE_EXIF, vpVIDEO_MODE_FORMAT7_0, vpVIDEO_MODE_FORMAT7_1, vpVIDEO_MODE_FORMAT7_2, vpVIDEO_MODE_FORMAT7_3, vpVIDEO_MODE_FORMAT7_4, vpVIDEO_MODE_FORMAT7_5, vpVIDEO_MODE_FORMAT7_6, and vpVIDEO_MODE_FORMAT7_7.

Referenced by setFramerate().

bool vp1394TwoGrabber::isVideoModeFormat7 ( vp1394TwoVideoModeType  videomode)

Indicates if the video mode is format 7.

Parameters
videomode: The video mode to check for.
Returns
true : If the video mode is scalable (Format 7).
false : If the video mode is not Format 7 like.
See also
setVideoMode(), getVideoModeSupported(), setCamera()

Definition at line 614 of file vp1394TwoGrabber.cpp.

Referenced by setFramerate().

bool vp1394TwoGrabber::isVideoModeSupported ( vp1394TwoVideoModeType  videomode)

Check for the active camera video mode.

Parameters
videomode: The video mode to check for.
Returns
true if the active camera supports the desired video mode.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't get video modes.
See also
setVideoMode(), getVideoMode(), getCamera()

Definition at line 577 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by setVideoMode().

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

Exist only for compatibility with other grabbing devices.

Call acquire(vpImage<unsigned char> &I)

Parameters
I: Image data structure (8 bits image)
See also
acquire(vpImage<unsigned char> &I)

Implements vpFrameGrabber.

Examples:
HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, test1394TwoGrabber.cpp, tutorial-apriltag-detector-live.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-mb-generic-tracker-live.cpp, and tutorial-pose-from-points-live.cpp.

Definition at line 2077 of file vp1394TwoGrabber.cpp.

References acquire(), and open().

Referenced by acquire(), dequeue(), open(), setFormat7ROI(), setFramerate(), setPanControl(), and setVideoMode().

void vp1394TwoGrabber::open ( vpImage< vpRGBa > &  I)
virtual

Exist only for compatibility with other grabbing devices.

Call acquire(vpImage<vpRGBa> &I)

Parameters
I: Image data structure (RGBa format)
See also
acquire(vpImage<vpRGBa> &I)

Implements vpFrameGrabber.

Definition at line 2093 of file vp1394TwoGrabber.cpp.

References acquire(), and open().

vp1394TwoGrabber & vp1394TwoGrabber::operator>> ( vpImage< unsigned char > &  I)

Operator that allows to capture a grey level image.

Parameters
I: The captured image.
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
g >> I;
}

Definition at line 3383 of file vp1394TwoGrabber.cpp.

References acquire().

vp1394TwoGrabber & vp1394TwoGrabber::operator>> ( vpImage< vpRGBa > &  I)

Operator that allows to capture a grey level image.

Parameters
I: The captured image.
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
g >> I;
}

Definition at line 3405 of file vp1394TwoGrabber.cpp.

References acquire().

void vp1394TwoGrabber::printCameraInfo ( )

Display camera information for the active camera.

See also
setCamera()

Definition at line 2752 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, and vpERROR_TRACE.

void vp1394TwoGrabber::resetBus ( )

Resets the IEEE1394 bus which camera is attached to. Calling this function is "rude" to other devices because it causes them to re-enumerate on the bus and may cause a temporary disruption in their current activities. Thus, use it sparingly. Its primary use is if a program shuts down uncleanly and needs to free leftover ISO channels or bandwidth. A bus reset will free those things as a side effect.

The example below shows how to reset the bus attached to the last camera found.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
unsigned int ncameras; // Number of cameras on the bus
ncameras = g.getNumCameras();
g.setCamera(ncameras-1); // To dial with the last camera on the bus
g.resetBus(); // Reset the bus attached to "ncameras-1"
#endif
}
Exceptions
vpFrameGrabberException::initializationError: If no camera is found.
Examples:
test1394TwoResetBus.cpp.

Definition at line 2992 of file vp1394TwoGrabber.cpp.

References vpFrameGrabber::init, setCamera(), and vpTime::wait().

void vp1394TwoGrabber::setAutoGain ( bool  enable = true)

Enable auto gain. It is also possible to set the min and max gain, but only for AVT cameras. In that case use setAutoGain(unsigned int, unsigned int).

Parameters
enable: Flag to enable or disable the auto gain. If false, set the gain as manual.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoGain(true); // Enable auto gain
while(1)
g.acquire(I);
#endif
}
Exceptions
vpFrameGrabberException::settingError: If we can't set the auto shutter.
See also
setAutoGain(unsigned int, unsigned int), getAutoGain()

Definition at line 1766 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by setAutoGain().

void vp1394TwoGrabber::setAutoGain ( unsigned int  minvalue,
unsigned int  maxvalue 
)

Enable auto gain. If available set min and max gain values.

Warning
Setting min and max gain feature is only available for AVT cameras.
Parameters
minvalue: Min gain.
maxvalue: Max gain.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoGain(1600*20-1, 1600*20); // Set gain min and max values
while(1)
g.acquire(I);
#endif
}
Exceptions
vpFrameGrabberException::settingError: If we can't set the auto shutter.
See also
setAutoGain(), getAutoGain()

Definition at line 1833 of file vp1394TwoGrabber.cpp.

References close(), setAutoGain(), and vpFrameGrabberException::settingError.

void vp1394TwoGrabber::setAutoShutter ( bool  enable = true)

Enable auto shutter. It is also possible to set auto shutter min and max exposure time, but only for AVT cameras. In that case use setAutoShutter(unsigned int, unsigned int).

Parameters
enable: Flag to enable or disable the auto shutter. If false, set the shutter as manual.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(); // Enable auto shutter
while(1)
g.acquire(I);
#endif
}
Exceptions
vpFrameGrabberException::settingError: If we can't set the auto shutter.
See also
setAutoShutter(unsigned int, unsigned int), getAutoShutter()

Definition at line 1620 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, and vpERROR_TRACE.

Referenced by setAutoShutter().

void vp1394TwoGrabber::setAutoShutter ( unsigned int  minvalue,
unsigned int  maxvalue 
)

Set auto shutter. If available set min and max exposure time.

Warning
Setting min and max exposure time feature is only available for AVT cameras.
Parameters
minvalue: Min shutter exposure time.
maxvalue: Max shutter exposure time.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(1600*20-1, 1600*20); // Set shutter min and max values
while(1)
g.acquire(I);
#endif
}
Exceptions
vpFrameGrabberException::settingError: If we can't set the auto shutter.
See also
setAutoShutter(), getAutoShutter()

Definition at line 1687 of file vp1394TwoGrabber.cpp.

References close(), setAutoShutter(), and vpFrameGrabberException::settingError.

void vp1394TwoGrabber::setCamera ( uint64_t  cam_id)

If multiples cameras are connected on the bus, select the camero to dial with.

Parameters
cam_id: A camera identifier or GUID. By identifier, we mean a value comprised between 0 (the first camera found on the bus) and the number of cameras found on the bus and returned by getNumCameras() minus 1. If two cameras are connected on the bus, setting camera_id to one allows to communicate with the second one. This identifier is not unique. That is why, it is also possible to select a camera by its GUID, which is unique.
Exceptions
vpFrameGrabberException::settingError: If the required camera is not reachable.

Here an example of single capture from the last camera found on the bus:

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
unsigned int ncameras; // Number of cameras on the bus
ncameras = g.getNumCameras();
int last = 0;
if (ncameras > 1)
last = ncameras-1;
g.setCamera(last); // To dial with the last camera on the bus
while(1)
g.acquire(I);// I contains the frame captured by the last camera on the bus
#endif
}

If more than one camera is connected, it is also possible to select a specific camera by its GUID:

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/io/vpImageIo.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vpImage<unsigned char> I; // Create a gray level image container
bool reset = false; // Disable bus reset during construction
vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib
unsigned int ncameras; // Number of cameras on the bus
ncameras = g.getNumCameras();
std::cout << ncameras << " cameras found:" << std::endl;
for(int i=0; i< ncameras; i++)
{
g.setCamera(i);
uint64_t guid = g.getGuid();
printf("camera %d with guid 0x%lx\n", i, guid);
}
// produce:
// 2 cameras found:
// camera 0 with guid 0xb09d01009b329c
// camera 1 with guid 0xb09d01007e0ee7
g.setCamera( 0xb09d01009b329c );
printf("Use camera with GUID: 0x%lx\n", g.getGuid());
g.acquire(I); // Acquire an image from the camera with GUID 0xb09d01009b329c
vpImageIo::write(I, "image.pgm"); // Write image on the disk
#endif
}

Here an example of multi camera capture:

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
unsigned int ncameras; // Number of cameras on the bus
ncameras = g.getNumCameras();
// If the first camera supports vpVIDEO_MODE_640x480_YUV422 video mode
g.setCamera(0);
if (ncameras >= 2) {
// If the second camera support 30 fps acquisition
g.setCamera(1);
}
while(1) {
for (unsigned int camera=0; camera < ncameras; camera ++) {
g.setCamera(camera);
g.acquire(I[camera]);
}
}
delete [] I;
#endif
}
See also
setFormat(), setVideoMode(), setFramerate(), getNumCameras()
Examples:
manGrab1394-2.cpp, and test1394TwoGrabber.cpp.

Definition at line 285 of file vp1394TwoGrabber.cpp.

References close(), and vpFrameGrabberException::settingError.

Referenced by resetBus(), and setFormat7ROI().

void vp1394TwoGrabber::setColorCoding ( vp1394TwoColorCodingType  coding)

Set the active camera Format 7 color coding.

The iso transmission (setTransmission()) and the dma capture (see setCapture()) are first stopped. Then, the active camera Format 7 is set. Finaly, the dma capture and the iso transmission are re-started.

Warning
Setting color coding for non format 7 video mode will be without effect.
Parameters
coding: The camera color coding for Format 7 video mode. The current color coding of the camera is given by getColorCoding(). The camera supported color codings are given by getColorCodingSupported().
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't set the color coding for Format 7 video mode.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(1600*20-1, 1600*20); // Set shutter min and max values
while(1)
g.acquire(I);
#endif
}
See also
getColorCoding(), getColorCodingSupported() , setCamera()
Examples:
servoViper650Point2DCamVelocity.cpp, servoViper850Point2DCamVelocity.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 948 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, isColorCodingSupported(), and vpFrameGrabberException::settingError.

void vp1394TwoGrabber::setFormat7ROI ( unsigned int  left = 0,
unsigned int  top = 0,
unsigned int  w = 0,
unsigned int  h = 0 
)

Set the grabbed region of interest ie roi position and size for format 7 video mode.

The iso transmission (setTransmission()) and the dma capture (see setCapture()) are first stopped. Then, the format 7 roi is set. Finaly, the dma capture and the iso transmission are re-started.

Warning
Setting format 7 roi takes only effect if video mode is format 7 like.
Parameters
left: Position of the upper left roi corner.
top: Position of the upper left roi corner.
w: Roi width. If width is set to 0, uses the maximum allowed image width.
h: Roi height. If width is set to 0, uses the maximum allowed image height.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't set roi.
See also
isVideoModeFormat7()

Definition at line 1195 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabber::height, vpFrameGrabber::init, vpFrameGrabberException::initializationError, open(), setCamera(), vpFrameGrabberException::settingError, vpERROR_TRACE, vpTRACE, vpTime::wait(), and vpFrameGrabber::width.

void vp1394TwoGrabber::setFramerate ( vp1394TwoFramerateType  fps)

Set the active camera framerate for non scalable video modes.

The iso transmission (setTransmission()) and the dma capture (see setCapture()) are first stopped. Then, the camera framerate capture mode is set. Finaly, the dma capture and the iso transmission are re-started.

If the current video mode is scalable (Format 7), this function is without effect.

Parameters
fps: The camera framerate. The current framerate of the camera is given by getFramerate(). The camera supported framerates are given by getFramerateSupported().
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't set the framerate.
See also
getFramerate(), getFramerateSupported() , setCamera()
Examples:
manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, tutorial-grabber-1394-writer.cpp, and tutorial-grabber-1394.cpp.

Definition at line 685 of file vp1394TwoGrabber.cpp.

References close(), getVideoMode(), vpFrameGrabberException::initializationError, isFramerateSupported(), isVideoModeFormat7(), open(), and vpFrameGrabberException::settingError.

void vp1394TwoGrabber::setIsoTransmissionSpeed ( vp1394TwoIsoSpeedType  isospeed)

Set the camera iso data transmission speed. Speeds over 400Mbps are only available in "B" mode.

Parameters
isospeed: Iso data transmission speed.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't set the iso speed transmission.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(1600*20-1, 1600*20); // Set shutter min and max values
while(1)
g.acquire(I);
#endif
}

Definition at line 2009 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, vpERROR_TRACE, and vpISO_SPEED_800.

void vp1394TwoGrabber::setPanControl ( unsigned int  panControlValue)

This method is useful for controlling single or multiple image transmission from stereo vision cameras.

The PAN register 0x884 used to control which images are transmitted is set to the corresponding panControlValue value.

Parameters
panControlValue: Value used to set the PAN register 0x884. The Format_7 Mode 0 transmits images from one camera. When set to 0, transmit right image. When set to 1, transmit left (Bumblebee2) or center (Bumblebee XB3) image and when set to 2 or higher transmit left image. The Format_7 Mode 3 allows to transmit two images simultaneously. If your camera has two sensors, you can use the PAN register to control the order of the images when transmitting. Writing a value of 0 to this register transmits images in right-left format. A value of 1 transmits images in left-right format. If your camera has three sensors, such as the Bumblebee XB3, you can adjust the PAN register as follows to specify which two sensors are capturing images. When panControlValue is set to 0, transmit right-left images, when set to 1, transmit right-center images.
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If the register was not set.

Definition at line 3074 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, open(), vpFrameGrabberException::settingError, and vpERROR_TRACE.

void vp1394TwoGrabber::setParameterValue ( vp1394TwoParametersType  param,
unsigned int  val 
)

This method set the value of one of the parameters of the camera. The initial value of the parameter is recorded and reset when the destructor is called.

Warning
If the program crashes and the destructor is not called, then the modified parameters will remain in the camera.
Parameters
param: The parameters to modify
val: the new value of this parameter
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingErrorif a manual mode is not available for the parameter, an exception is thrown.
See also
getParameterValue()

Definition at line 3193 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabberException::initializationError, vpFrameGrabberException::settingError, vpERROR_TRACE, vpFEATURE_BRIGHTNESS, vpFEATURE_EXPOSURE, vpFEATURE_GAIN, vpFEATURE_GAMMA, vpFEATURE_HUE, vpFEATURE_IRIS, vpFEATURE_SATURATION, vpFEATURE_SHARPNESS, and vpFEATURE_SHUTTER.

Referenced by getGuid().

void vp1394TwoGrabber::setRingBufferSize ( unsigned int  size)

Set the ring buffer size used for the capture. To know the current ring buffer size see getRingBufferSize().

Parameters
size: Ring buffer size.
Exceptions
vpFrameGrabberException::settingError: If ring buffer size is not valid.
See also
getRingBufferSize()

Definition at line 1553 of file vp1394TwoGrabber.cpp.

References close(), and vpFrameGrabberException::settingError.

void vp1394TwoGrabber::setVideoMode ( vp1394TwoVideoModeType  videomode)

Set the camera video capture mode. Image size is than updated with respect to the new video capture mode.

The iso transmission (setTransmission()) and the dma capture (see setCapture()) are first stopped. Then, the camera video capture mode is set. Finaly, the dma capture and the iso transmission are re-started.

Parameters
videomode: The camera video capture mode. The current camera mode is given by getVideoMode(). The camera supported modes are given by getVideoModeSupported().
Exceptions
vpFrameGrabberException::initializationError: If no camera found on the bus.
vpFrameGrabberException::settingError: If we can't set the video mode.

Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g(false); // Don't reset the bus
g.setAutoShutter(1600*20-1, 1600*20); // Set shutter min and max values
while(1)
g.acquire(I);
#endif
}
See also
getVideoMode(), getVideoModeSupported(), setCamera()
Examples:
manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, tutorial-grabber-1394-writer.cpp, and tutorial-grabber-1394.cpp.

Definition at line 450 of file vp1394TwoGrabber.cpp.

References close(), vpFrameGrabber::height, vpFrameGrabberException::initializationError, isVideoModeSupported(), open(), vpFrameGrabberException::settingError, and vpFrameGrabber::width.

vp1394TwoGrabber::vp1394TwoColorCodingType vp1394TwoGrabber::string2colorCoding ( std::string  colorcoding)
static

Converts the string containing the description of the color coding into the color coding identifier.

Parameters
colorcoding: The string describing the color coding format.
Returns
The camera capture color coding identifier.
Exceptions
vpFrameGrabberException::settingError: If the required color coding is not valid.

This method returns 0 if the string does not match to a color coding string.

See also
colorCoding2string()

Definition at line 2945 of file vp1394TwoGrabber.cpp.

References colorCoding2string(), and vpFrameGrabberException::settingError.

vp1394TwoGrabber::vp1394TwoFramerateType vp1394TwoGrabber::string2framerate ( std::string  framerate)
static

Converts the string containing the description of the framerate into the framerate identifier.

Parameters
framerate: The string describing the framerate.
Returns
The camera capture framerate identifier.
Exceptions
vpFrameGrabberException::settingError: If the required framerate is not valid.

This method returns 0 if the string does not match to a framerate string.

See also
framerate2string()

Definition at line 2913 of file vp1394TwoGrabber.cpp.

References framerate2string(), and vpFrameGrabberException::settingError.

vp1394TwoGrabber::vp1394TwoVideoModeType vp1394TwoGrabber::string2videoMode ( std::string  videomode)
static

Converts the string containing the description of the vide mode into the video mode identifier.

Parameters
videomode: The string describing the video mode.
Returns
The camera capture video mode identifier.
Exceptions
vpFrameGrabberException::settingError: If the required videomode is not valid.

This method returns 0 if the string does not match to a video mode string.

See also
videoMode2string()

Definition at line 2881 of file vp1394TwoGrabber.cpp.

References vpFrameGrabberException::settingError, and videoMode2string().

std::string vp1394TwoGrabber::videoMode2string ( vp1394TwoVideoModeType  videomode)
static

Converts the video mode identifier into a string containing the description of the mode.

Parameters
videomode: The camera capture video mode.
Returns
A string describing the mode, an empty string if the mode is not supported.
See also
string2videoMode()
Examples:
grab1394Two.cpp.

Definition at line 2797 of file vp1394TwoGrabber.cpp.

References strVideoMode, and vpCERROR.

Referenced by string2videoMode().

Member Data Documentation

const char * vp1394TwoGrabber::strColorCoding
static
Initial value:
= {
"COLOR_CODING_MONO8", "COLOR_CODING_YUV411", "COLOR_CODING_YUV422", "COLOR_CODING_YUV444",
"COLOR_CODING_RGB8", "COLOR_CODING_MONO16", "COLOR_CODING_RGB16", "COLOR_CODING_MONO16S",
"COLOR_CODING_RGB16S", "COLOR_CODING_RAW8", "COLOR_CODING_RAW16",
}

Definition at line 192 of file vp1394TwoGrabber.h.

Referenced by colorCoding2string().

const char * vp1394TwoGrabber::strFramerate
static
Initial value:
= {
"FRAMERATE_1_875", "FRAMERATE_3_75", "FRAMERATE_7_5", "FRAMERATE_15",
"FRAMERATE_30", "FRAMERATE_60", "FRAMERATE_120", "FRAMERATE_240"}

Definition at line 191 of file vp1394TwoGrabber.h.

Referenced by framerate2string().

const char * vp1394TwoGrabber::strVideoMode
static
Initial value:
= {
"MODE_160x120_YUV444", "MODE_320x240_YUV422", "MODE_640x480_YUV411", "MODE_640x480_YUV422",
"MODE_640x480_RGB8", "MODE_640x480_MONO8", "MODE_640x480_MONO16", "MODE_800x600_YUV422",
"MODE_800x600_RGB8", "MODE_800x600_MONO8", "MODE_1024x768_YUV422", "MODE_1024x768_RGB8",
"MODE_1024x768_MONO8", "MODE_800x600_MONO16", "MODE_1024x768_MONO16", "MODE_1280x960_YUV422",
"MODE_1280x960_RGB8", "MODE_1280x960_MONO8", "MODE_1600x1200_YUV422", "MODE_1600x1200_RGB8",
"MODE_1600x1200_MONO8", "MODE_1280x960_MONO16", "MODE_1600x1200_MONO16", "MODE_EXIF",
"MODE_FORMAT7_0", "MODE_FORMAT7_1", "MODE_FORMAT7_2", "MODE_FORMAT7_3",
"MODE_FORMAT7_4", "MODE_FORMAT7_5", "MODE_FORMAT7_6", "MODE_FORMAT7_7"}

Definition at line 190 of file vp1394TwoGrabber.h.

Referenced by videoMode2string().