15 #include <visiontransfer/deviceenumeration.h> 16 #include <visiontransfer/imagetransfer.h> 17 #include <visiontransfer/imagepair.h> 24 #define snprintf _snprintf_s 34 if(devices.size() == 0) {
35 std::cout <<
"No devices discovered!" << std::endl;
40 std::cout <<
"Discovered devices:" << std::endl;
41 for(
unsigned int i = 0; i< devices.size(); i++) {
42 std::cout << devices[i].toString() << std::endl;
44 std::cout << std::endl;
51 for(
int i=0; i<100; i++) {
52 std::cout <<
"Receiving image " << i << std::endl;
56 while(!imageTransfer.receiveImagePair(imagePair)) {
61 for(
int imageNumber = 0; imageNumber <=1; imageNumber++) {
64 snprintf(fileName,
sizeof(fileName),
"image%03d_%d.pgm", i,
70 }
catch(
const std::exception& ex) {
71 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
DeviceList discoverDevices()
Discovers new devices and returns the list of all devices that have been found.
Class for synchronous transfer of image pairs.
void writePgmFile(int imageNumber, const char *fileName) const
Writes one image of the pair to a PGM or PPM file.
Allows for the discovery of devices in the network.
A set of two images, which are usually the left camera image and the disparity map.