tutorial-visp-grabber-1394.cpp
Go to the documentation of this file.
00001 
00002 #include <visp/vp1394TwoGrabber.h>
00003 #include <visp/vpDisplayX.h>
00004 #include <visp/vpImage.h>
00005 
00006 int main()
00007 {
00008 #ifdef VISP_HAVE_DC1394_2
00009   try {
00010     vpImage<unsigned char> I; // Create a gray level image container
00011     bool reset = true; // Enable bus reset during construction (default)
00012     vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib
00013 
00014     g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8);
00015     g.setFramerate(vp1394TwoGrabber::vpFRAMERATE_60);
00016     g.open(I);
00017 
00018     std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
00019 
00020 #ifdef VISP_HAVE_X11
00021     vpDisplayX d(I);
00022 #else
00023     std::cout << "No image viewer is available..." << std::endl;
00024 #endif
00025 
00026     while(1) {
00027       g.acquire(I);
00028       vpDisplay::display(I);
00029       vpDisplay::flush(I);
00030       if (vpDisplay::getClick(I, false))
00031         break;
00032     }
00033   }
00034   catch(vpException e) {
00035     std::cout << "Catch an exception: " << e << std::endl;
00036   }
00037 #endif
00038 }


visp_ros
Author(s): Francois Pasteau, Fabien Spindler
autogenerated on Wed Aug 26 2015 16:44:33