15 #include <visiontransfer/deviceenumeration.h> 16 #include <visiontransfer/asynctransfer.h> 17 #include <visiontransfer/imageset.h> 24 #define snprintf _snprintf_s 33 DeviceEnumeration::DeviceList devices =
35 if(devices.size() == 0) {
36 std::cout <<
"No devices discovered!" << std::endl;
41 std::cout <<
"Discovered devices:" << std::endl;
42 for(
unsigned int i = 0; i< devices.size(); i++) {
43 std::cout << devices[i].toString() << std::endl;
45 std::cout << std::endl;
52 for(
int imgNum=0; imgNum<100; imgNum++) {
53 std::cout <<
"Receiving image set " << imgNum << std::endl;
57 while(!asyncTransfer.collectReceivedImageSet(imageSet,
66 snprintf(fileName,
sizeof(fileName),
"image%03d_%d.pgm", i,
72 }
catch(
const std::exception& ex) {
73 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
DeviceList discoverDevices()
Discovers new devices and returns the list of all devices that have been found.
void writePgmFile(int imageNumber, const char *fileName) const
Writes one image of the set to a PGM or PPM file.
int getNumberOfImages() const
Returns the number of images in this set.
A set of one to three images, but usually two (the left camera image and the disparity map)...
Class for asynchronous transfer of image sets.
Allows for the discovery of devices in the network.