45 #include <visp3/core/vpConfig.h> 46 #include <visp3/core/vpDebug.h> 51 #if defined(VISP_HAVE_PYLON) 53 #include <visp3/core/vpIoTools.h> 54 #include <visp3/io/vpImageIo.h> 55 #include <visp3/sensor/vpPylonFactory.h> 62 std::cout <<
"Basler camera test with Pylon in progress..." << std::endl;
67 std::string outputpath =
"/tmp/" + username;
79 unsigned int ncameras;
81 for (
unsigned int i = 0; i < ncameras; i++) {
84 std::cout <<
"Detected camera with serial: " << guid << std::endl;
90 std::cout <<
"Use camera with serial: " << guid << std::endl;
98 std::cout <<
"Frame rate: " << g->
getFrameRate() << std::endl;
99 std::cout <<
"Gain: " << g->
getGain() << std::endl;
100 std::cout <<
"Gamma: " << g->
getGamma() << std::endl;
101 std::cout <<
"Exposure time (ms): " << g->
getExposure() << std::endl;
103 std::cout <<
"Black level: " << blackLevel << std::endl;
105 for (
int i = 0; i < 10; i++)
108 std::cout <<
"Current image size: " << g->
getWidth() <<
"x" << g->
getHeight() << std::endl;
110 std::string filename = outputpath +
"/imagetest1.pgm";
111 std::cout <<
"Write image: " << filename << std::endl;
114 std::cout <<
"New connection..." << std::endl;
118 std::cout <<
"New connection..." << std::endl;
121 filename = outputpath +
"/imagetest2.pgm";
122 std::cout <<
"Write image: " << filename << std::endl;
126 }
catch (
const std::exception &e) {
129 vpCERROR <<
"Failure: exit" << std::endl;
135 vpTRACE(
"Basler Pylon grabber capabilities are not available...\n" 136 "You should install pylon SDK to use this binary.");
virtual unsigned int getNumCameras()=0
Get the number of cameras of specific subclasses. GigE, USB, etc.
virtual void setCameraSerial(const std::string &serial)=0
virtual void open(vpImage< unsigned char > &I)=0
virtual float getBlackLevel()=0
virtual float getGain()=0
error that can be emited by ViSP classes.
virtual void close()=0
Stop active camera capturing images and disconnect the active camera.
static void write(const vpImage< unsigned char > &I, const std::string &filename)
const char * what() const
virtual float getFrameRate()=0
Factory singleton class to create vpPylonGrabber subclass instances.
unsigned int getWidth() const
Return the number of columns in the image.
virtual std::string getCameraSerial(unsigned int index)=0
virtual void acquire(vpImage< unsigned char > &I)=0
static vpPylonFactory & instance()
Get the vpPylonFactory singleton.
virtual void setCameraIndex(unsigned int index)=0
virtual std::ostream & getCameraInfo(std::ostream &os)=0
virtual float getGamma()=0
vpPylonGrabber * createPylonGrabber(DeviceClass dev_class)
Create an object of vpPylonGrabber.
unsigned int getHeight() const
Return the number of rows in the image.
virtual float getExposure()=0