15 #include <visiontransfer/deviceenumeration.h> 16 #include <visiontransfer/asynctransfer.h> 17 #include <visiontransfer/imageset.h> 18 #include <visiontransfer/reconstruct3d.h> 25 #define snprintf _snprintf_s 34 DeviceEnumeration::DeviceList devices =
36 if(devices.size() == 0) {
37 std::cout <<
"No devices discovered!" << std::endl;
42 std::cout <<
"Discovered devices:" << std::endl;
43 for(
unsigned int i = 0; i< devices.size(); i++) {
44 std::cout << devices[i].toString() << std::endl;
46 std::cout << std::endl;
53 for(
int imgNum=0; imgNum<100; imgNum++) {
54 std::cout <<
"Receiving image set " << imgNum << std::endl;
58 while(!asyncTransfer.collectReceivedImageSet(imageSet,
71 snprintf(fileName,
sizeof(fileName),
"pointcloud%03d.ply", imgNum);
76 }
catch(
const std::exception& ex) {
77 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
Transforms a disparity map into a set of 3D points.
DeviceList discoverDevices()
Discovers new devices and returns the list of all devices that have been found.
void writePlyFile(const char *file, const ImageSet &imageSet, double maxZ=(std::numeric_limits< double >::max)(), bool binary=false, ColorSource colSource=COLOR_AUTO, unsigned short maxDisparity=0xFFF)
Projects the given disparity map to 3D points and exports the result to a PLY file.
float * createPointMap(const ImageSet &imageSet, unsigned short minDisparity=0, unsigned short maxDisparity=0xFFF)
Reconstructs the 3D location of each pixel in the given disparity map.
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.