#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#include <iostream>
#include <string>
#if defined(VISP_HAVE_PYLON)
#include <visp3/core/vpIoTools.h>
#include <visp3/io/vpImageIo.h>
#include <visp3/sensor/vpPylonFactory.h>
int main()
{
try {
std::cout << "Basler camera test with Pylon in progress..." << std::endl;
std::string username;
std::string outputpath = "/tmp/" + username;
std::string guid;
unsigned int ncameras;
for (unsigned int i = 0; i < ncameras; i++) {
std::cout << "Detected camera with serial: " << guid << std::endl;
}
if (ncameras > 1) {
std::cout << "Use camera with serial: " << guid << std::endl;
}
std::cout <<
"Frame rate: " << g->
getFrameRate() << std::endl;
std::cout <<
"Gain: " << g->
getGain() << std::endl;
std::cout <<
"Gamma: " << g->
getGamma() << std::endl;
std::cout <<
"Exposure time (ms): " << g->
getExposure() << std::endl;
std::cout << "Black level: " << blackLevel << std::endl;
for (int i = 0; i < 10; i++)
std::cout <<
"Current image size: " << g->
getWidth() <<
"x" << g->
getHeight() << std::endl;
std::string filename = outputpath + "/imagetest1.pgm";
std::cout << "Write image: " << filename << std::endl;
std::cout << "New connection..." << std::endl;
std::cout << "New connection..." << std::endl;
filename = outputpath + "/imagetest2.pgm";
std::cout << "Write image: " << filename << std::endl;
} catch (const GenericException &e) {
} catch (const std::exception &e) {
} catch (...) {
vpCERROR <<
"Failure: exit" << std::endl;
}
}
#else
int main()
{
vpTRACE(
"Basler Pylon grabber capabilities are not available...\n" "You should install pylon SDK to use this binary.");
}
#endif