2 #include <visp3/core/vpImage.h> 3 #include <visp3/gui/vpDisplayGDI.h> 4 #include <visp3/gui/vpDisplayOpenCV.h> 5 #include <visp3/gui/vpDisplayX.h> 6 #include <visp3/sensor/vpPylonFactory.h> 14 int main(
int argc,
const char *argv[])
16 #ifdef VISP_HAVE_PYLON 18 unsigned int opt_camera = 0;
19 std::string opt_device(
"GigE");
21 for (
int i = 0; i < argc; i++) {
22 if (std::string(argv[i]) ==
"--camera")
23 opt_camera = (
unsigned int)atoi(argv[i + 1]);
24 if (std::string(argv[i]) ==
"--device")
25 opt_device = std::string(argv[i + 1]);
26 else if (std::string(argv[i]) ==
"--help") {
27 std::cout <<
"Usage: " << argv[0] <<
" [--camera <0...9>] [--device <\"GigE\"|\"USB\">] [--help]" << std::endl;
37 if (opt_device ==
"GigE" || opt_device ==
"gige") {
39 std::cout <<
"Opening Basler GigE camera: " << opt_camera << std::endl;
40 }
else if (opt_device ==
"USB" || opt_device ==
"usb") {
42 std::cout <<
"Opening Basler USB camera: " << opt_camera << std::endl;
44 std::cout <<
"Error: only Basler GigE or USB cameras are supported." << std::endl;
55 #elif defined(VISP_HAVE_GDI) 57 #elif defined(VISP_HAVE_OPENCV) 60 std::cout <<
"No image viewer is available..." << std::endl;
72 std::cout <<
"Catch an exception: " << e << std::endl;
virtual void open(vpImage< unsigned char > &I)=0
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Display for windows using GDI (available on any windows 32 platform).
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
error that can be emited by ViSP classes.
static void flush(const vpImage< unsigned char > &I)
Factory singleton class to create vpPylonGrabber subclass instances.
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
virtual void acquire(vpImage< unsigned char > &I)=0
static vpPylonFactory & instance()
Get the vpPylonFactory singleton.
virtual void setCameraIndex(unsigned int index)=0
unsigned int getHeight() const
vpPylonGrabber * createPylonGrabber(DeviceClass dev_class)
Create an object of vpPylonGrabber.
unsigned int getWidth() const