Visual Servoing Platform  version 3.6.1 under development (2024-03-18)
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/vpDisplayOpenCV.h>
    #include <visp3/gui/vpDisplayX.h>
    #include <visp3/io/vpImageStorageWorker.h>
    #include <visp3/sensor/vp1394TwoGrabber.h>
    void usage(const char *argv[], int error)
    {
    std::cout << "SYNOPSIS" << std::endl
    << " " << argv[0] << " [--change-settings]"
    << " [--seqname <sequence name>]"
    << " [--record <mode>]"
    << " [--no-display]"
    << " [--help] [-h]" << std::endl
    << std::endl;
    std::cout << "DESCRIPTION" << std::endl
    << " --change-settings" << std::endl
    << " Force camera settings to acquire 640x480 images in M0NO8 at 60 fps." << std::endl
    << std::endl
    << " --seqname <sequence name>" << std::endl
    << " Name of the sequence of image to create (ie: /tmp/image%04d.jpg)." << std::endl
    << " Default: empty." << std::endl
    << std::endl
    << " --record <mode>" << std::endl
    << " Allowed values for mode are:" << std::endl
    << " 0: record all the captures images (continuous mode)," << std::endl
    << " 1: record only images selected by a user click (single shot mode)." << std::endl
    << " Default mode: 0" << std::endl
    << std::endl
    << " --no-display" << std::endl
    << " Disable displaying captured images." << std::endl
    << " When used and sequence name specified, record mode is internally set to 1 (continuous mode)."
    << std::endl
    << std::endl
    << " --help, -h" << std::endl
    << " Print this helper message." << std::endl
    << std::endl;
    std::cout << "USAGE" << std::endl
    << " Example to visualize images:" << std::endl
    << " " << argv[0] << std::endl
    << std::endl
    << " Examples to record a sequence:" << std::endl
    << " " << argv[0] << " --seqname I%04d.png" << std::endl
    << " " << argv[0] << " --seqname folder/I%04d.png --record 0" << std::endl
    << std::endl
    << " Examples to record single shot images:\n"
    << " " << argv[0] << " --seqname I%04d.png --record 1\n"
    << " " << argv[0] << " --seqname folder/I%04d.png --record 1" << std::endl
    << std::endl;
    if (error) {
    std::cout << "Error" << std::endl
    << " "
    << "Unsupported parameter " << argv[error] << std::endl;
    }
    }
    int main(int argc, const char *argv[])
    {
    #if defined(VISP_HAVE_DC1394) && defined(VISP_HAVE_THREADS)
    try {
    std::string opt_seqname;
    int opt_record_mode = 0;
    bool opt_change_settings = false;
    bool opt_display = true;
    for (int i = 1; i < argc; i++) {
    if (std::string(argv[i]) == "--change-settings") {
    opt_change_settings = true;
    }
    else if (std::string(argv[i]) == "--seqname") {
    opt_seqname = std::string(argv[i + 1]);
    i++;
    }
    else if (std::string(argv[i]) == "--record") {
    opt_record_mode = std::atoi(argv[i + 1]);
    i++;
    }
    else if (std::string(argv[i]) == "--no-display") {
    opt_display = false;
    }
    else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
    usage(argv, 0);
    return EXIT_SUCCESS;
    }
    else {
    usage(argv, i);
    return EXIT_FAILURE;
    }
    }
    if ((!opt_display) && (!opt_seqname.empty())) {
    opt_record_mode = 0;
    }
    std::cout << "Settings : " << (opt_change_settings ? "modified" : "current") << std::endl;
    std::cout << "Recording : " << (opt_seqname.empty() ? "disabled" : "enabled") << std::endl;
    std::cout << "Display : " << (opt_display ? "enabled" : "disabled") << 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<vpRGBa> I; // Create a color 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;
    vpDisplay *d = nullptr;
    if (opt_display) {
    #if !(defined(VISP_HAVE_X11) || defined(VISP_HAVE_OPENCV))
    std::cout << "No image viewer is available..." << std::endl;
    opt_display = false;
    #endif
    }
    if (opt_display) {
    #ifdef VISP_HAVE_X11
    d = new vpDisplayX(I);
    #elif defined(HAVE_OPENCV_HIGHGUI)
    d = new vpDisplayOpenCV(I);
    #endif
    }
    vpImageQueue<vpRGBa> image_queue(opt_seqname, opt_record_mode);
    vpImageStorageWorker<vpRGBa> image_storage_worker(std::ref(image_queue));
    std::thread image_storage_thread(&vpImageStorageWorker<vpRGBa>::run, &image_storage_worker);
    bool quit = false;
    while (!quit) {
    double t = vpTime::measureTimeMs();
    g.acquire(I);
    quit = image_queue.record(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);
    }
    image_queue.cancel();
    image_storage_thread.join();
    if (d) {
    delete d;
    }
    }
    catch (const vpException &e) {
    std::cout << "Catch an exception: " << e << std::endl;
    }
    #else
    (void)argc;
    (void)argv;
    #ifndef VISP_HAVE_DC1394
    std::cout << "Install libdc1394, configure and build ViSP again to use this example" << std::endl;
    #endif
    #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
    std::cout << "This tutorial should be built with c++11 support" << std::endl;
    #endif
    #endif
    }
    Class for firewire ieee1394 video devices using libdc1394-2.x api.
    static const vpColor red
    Definition: vpColor.h:211
    The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
    Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
    Definition: vpDisplayX.h:128
    Class that defines generic functionalities for display.
    Definition: vpDisplay.h:173
    static void display(const vpImage< unsigned char > &I)
    static void flush(const vpImage< unsigned char > &I)
    static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
    error that can be emitted by ViSP classes.
    Definition: vpException.h:59
    unsigned int getWidth() const
    Definition: vpImage.h:249
    unsigned int getHeight() const
    Definition: vpImage.h:184
    VISP_EXPORT double measureTimeMs()
    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/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
    }
    static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
    Definition: vpImageIo.cpp:287
  • Here an example of multi camera capture. An other example is available in setCamera():
    #include <sstream>
    #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]);
    std::stringstream ss;
    ss << image-cam << camera << ".pgm";
    vpImageIo::write(I[camera], ss.str());
    }
    delete [] I;
    #endif
    }
Examples
HelloWorldOgre.cpp, HelloWorldOgreAdvanced.cpp, SickLDMRS-Process.cpp, grab1394Two.cpp, manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650FourPoints2DArtVelocityLs_cur.cpp, servoViper650FourPoints2DCamVelocityLs_cur.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_cur.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850FourPoints2DCamVelocityLs_cur.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.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 178 of file vp1394TwoGrabber.h.

Member Enumeration Documentation

◆ vp1394TwoColorCodingType

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 260 of file vp1394TwoGrabber.h.

◆ vp1394TwoFramerateType

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 244 of file vp1394TwoGrabber.h.

◆ vp1394TwoIsoSpeedType

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 190 of file vp1394TwoGrabber.h.

◆ vp1394TwoParametersType

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 279 of file vp1394TwoGrabber.h.

◆ vp1394TwoVideoModeType

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 204 of file vp1394TwoGrabber.h.

Constructor & Destructor Documentation

◆ vp1394TwoGrabber()

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/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 119 of file vp1394TwoGrabber.cpp.

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

◆ ~vp1394TwoGrabber()

vp1394TwoGrabber::~vp1394TwoGrabber ( )
virtual

Destructor.

Close the firewire grabber.

See also
close()

Definition at line 149 of file vp1394TwoGrabber.cpp.

References close().

Member Function Documentation

◆ acquire() [1/4]

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
HelloWorldOgreAdvanced.cpp, SickLDMRS-Process.cpp, manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, test1394TwoGrabber.cpp, test1394TwoResetBus.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-grabber-1394-writer.cpp, tutorial-me-ellipse-tracker.cpp, and tutorial-me-line-tracker.cpp.

Definition at line 2495 of file vp1394TwoGrabber.cpp.

References dequeue(), and enqueue().

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

◆ acquire() [2/4]

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 2524 of file vp1394TwoGrabber.cpp.

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

◆ acquire() [3/4]

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 2546 of file vp1394TwoGrabber.cpp.

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

◆ acquire() [4/4]

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 2575 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().

◆ close()

◆ colorCoding2string()

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 2840 of file vp1394TwoGrabber.cpp.

References strColorCoding, and vpCERROR.

Referenced by string2colorCoding().

◆ dequeue() [1/5]

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/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
}
void setVideoMode(vp1394TwoVideoModeType videomode)
void enqueue(dc1394video_frame_t *frame)
void setFramerate(vp1394TwoFramerateType fps)
dc1394video_frame_t * dequeue()
See also
enqueue()
Examples
SickLDMRS-Process.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 2129 of file vp1394TwoGrabber.cpp.

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

Referenced by acquire(), and dequeue().

◆ dequeue() [2/5]

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/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 2187 of file vp1394TwoGrabber.cpp.

References dequeue().

◆ dequeue() [3/5]

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/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 2246 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().

◆ dequeue() [4/5]

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/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 2342 of file vp1394TwoGrabber.cpp.

References dequeue().

◆ dequeue() [5/5]

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/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 2401 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().

◆ enqueue()

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
SickLDMRS-Process.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 2469 of file vp1394TwoGrabber.cpp.

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

Referenced by acquire().

◆ framerate2string()

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 2813 of file vp1394TwoGrabber.cpp.

References strFramerate, and vpCERROR.

Referenced by string2framerate().

◆ getAutoGain()

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.

◆ getAutoShutter()

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 1712 of file vp1394TwoGrabber.cpp.

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

◆ getCamera() [1/2]

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 352 of file vp1394TwoGrabber.cpp.

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

◆ getCamera() [2/2]

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 326 of file vp1394TwoGrabber.cpp.

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

◆ getColorCoding()

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 993 of file vp1394TwoGrabber.cpp.

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

Referenced by isColor().

◆ getColorCodingSupported()

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 1053 of file vp1394TwoGrabber.cpp.

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

◆ getFramerate()

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 727 of file vp1394TwoGrabber.cpp.

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

◆ getFramerateSupported()

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 775 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.

◆ getGuid() [1/2]

uint64_t vp1394TwoGrabber::getGuid ( )

Return the actual camera GUID.

See also
setCamera(), getCamera()
Examples
test1394TwoGrabber.cpp.

Definition at line 3314 of file vp1394TwoGrabber.cpp.

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

◆ getGuid() [2/2]

void vp1394TwoGrabber::getGuid ( uint64_t &  guid)

Query the actual camera GUID.

See also
setCamera(), getCamera()

Definition at line 3296 of file vp1394TwoGrabber.cpp.

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

◆ getHeight() [1/3]

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 2724 of file vp1394TwoGrabber.cpp.

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

◆ getHeight() [2/3]

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 106 of file vpFrameGrabber.h.

◆ getHeight() [3/3]

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 2697 of file vp1394TwoGrabber.cpp.

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

◆ getNumCameras() [1/2]

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 388 of file vp1394TwoGrabber.cpp.

References vpCTRACE.

◆ getNumCameras() [2/2]

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
SickLDMRS-Process.cpp, manGrab1394-2.cpp, and test1394TwoGrabber.cpp.

Definition at line 371 of file vp1394TwoGrabber.cpp.

References vpCTRACE.

◆ getParameterValue()

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 3100 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.

◆ getRingBufferSize()

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 1581 of file vp1394TwoGrabber.cpp.

◆ getVideoMode()

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 492 of file vp1394TwoGrabber.cpp.

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

Referenced by setFramerate().

◆ getVideoModeSupported()

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 527 of file vp1394TwoGrabber.cpp.

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

◆ getWidth() [1/3]

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 2669 of file vp1394TwoGrabber.cpp.

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

◆ getWidth() [2/3]

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 108 of file vpFrameGrabber.h.

◆ getWidth() [3/3]

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 2641 of file vp1394TwoGrabber.cpp.

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

◆ isColor()

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 632 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.

◆ isColorCodingSupported()

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 1118 of file vp1394TwoGrabber.cpp.

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

Referenced by setColorCoding().

◆ isFramerateSupported()

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 851 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().

◆ isVideoModeFormat7()

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 608 of file vp1394TwoGrabber.cpp.

Referenced by setFramerate().

◆ isVideoModeSupported()

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 571 of file vp1394TwoGrabber.cpp.

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

Referenced by setVideoMode().

◆ open() [1/2]

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
HelloWorldOgreAdvanced.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoPtu46Point2DArtVelocity.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, test1394TwoGrabber.cpp, tutorial-blob-tracker-live-firewire.cpp, and tutorial-grabber-1394-writer.cpp.

Definition at line 2070 of file vp1394TwoGrabber.cpp.

References acquire(), and open().

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

◆ open() [2/2]

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 2086 of file vp1394TwoGrabber.cpp.

References acquire(), and open().

◆ operator>>() [1/2]

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 3375 of file vp1394TwoGrabber.cpp.

References acquire().

◆ operator>>() [2/2]

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 3397 of file vp1394TwoGrabber.cpp.

References acquire().

◆ printCameraInfo()

void vp1394TwoGrabber::printCameraInfo ( )

Display camera information for the active camera.

See also
setCamera()

Definition at line 2740 of file vp1394TwoGrabber.cpp.

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

◆ resetBus()

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/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
}
void setCamera(uint64_t camera)
void getNumCameras(unsigned int &ncameras) const
Exceptions
vpFrameGrabberException::initializationError: If no camera is found.
Examples
test1394TwoResetBus.cpp.

Definition at line 2983 of file vp1394TwoGrabber.cpp.

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

◆ setAutoGain() [1/2]

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/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
g.setIsoTransmissionSpeed(vp1394TwoGrabber::vpISO_SPEED_800); // 1394b
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().

◆ setAutoGain() [2/2]

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/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
g.setIsoTransmissionSpeed(vp1394TwoGrabber::vpISO_SPEED_800); // 1394b
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.

◆ setAutoShutter() [1/2]

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/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
g.setIsoTransmissionSpeed(vp1394TwoGrabber::vpISO_SPEED_800); // 1394b
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 1621 of file vp1394TwoGrabber.cpp.

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

Referenced by setAutoShutter().

◆ setAutoShutter() [2/2]

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/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
}
Exceptions
vpFrameGrabberException::settingError: If we can't set the auto shutter.
See also
setAutoShutter(), getAutoShutter()

Definition at line 1688 of file vp1394TwoGrabber.cpp.

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

◆ setCamera()

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/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
}
void acquire(vpImage< unsigned char > &I)

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

#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/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 277 of file vp1394TwoGrabber.cpp.

References close(), and vpFrameGrabberException::settingError.

Referenced by resetBus().

◆ setColorCoding()

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. finally, 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/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
getColorCoding(), getColorCodingSupported() , setCamera()
Examples
servoViper650Point2DCamVelocity.cpp, servoViper850Point2DCamVelocity.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 941 of file vp1394TwoGrabber.cpp.

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

◆ setFormat7ROI()

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. finally, 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 1194 of file vp1394TwoGrabber.cpp.

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

◆ setFramerate()

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. finally, 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, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, and tutorial-grabber-1394-writer.cpp.

Definition at line 679 of file vp1394TwoGrabber.cpp.

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

◆ setIsoTransmissionSpeed()

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/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
}

Definition at line 2009 of file vp1394TwoGrabber.cpp.

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

◆ setPanControl()

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 3065 of file vp1394TwoGrabber.cpp.

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

◆ setParameterValue()

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 3184 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.

◆ setRingBufferSize()

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 1555 of file vp1394TwoGrabber.cpp.

References close(), and vpFrameGrabberException::settingError.

◆ setVideoMode()

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. finally, 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/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
getVideoMode(), getVideoModeSupported(), setCamera()
Examples
manGrab1394-2.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, and tutorial-grabber-1394-writer.cpp.

Definition at line 444 of file vp1394TwoGrabber.cpp.

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

◆ string2colorCoding()

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 2937 of file vp1394TwoGrabber.cpp.

References colorCoding2string(), and vpFrameGrabberException::settingError.

◆ string2framerate()

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 2905 of file vp1394TwoGrabber.cpp.

References framerate2string(), and vpFrameGrabberException::settingError.

◆ string2videoMode()

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 2873 of file vp1394TwoGrabber.cpp.

References vpFrameGrabberException::settingError, and videoMode2string().

◆ 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 2786 of file vp1394TwoGrabber.cpp.

References strVideoMode, and vpCERROR.

Referenced by string2videoMode().

Member Data Documentation

◆ height

◆ init

◆ strColorCoding

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 184 of file vp1394TwoGrabber.h.

Referenced by colorCoding2string().

◆ strFramerate

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 183 of file vp1394TwoGrabber.h.

Referenced by framerate2string().

◆ strVideoMode

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 182 of file vp1394TwoGrabber.h.

Referenced by videoMode2string().

◆ width