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
28 using namespace visiontransfer;
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,
72 snprintf(fileName,
sizeof(fileName),
"pointcloud%03d.ply", imgNum);
77 }
catch(
const std::exception& ex) {
78 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
DeviceList discoverDevices()
Discovers new devices and returns the list of all devices that have been found.
Allows for the discovery of devices in the network.
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.
A set of one to three images, but usually two (the left camera image and the disparity map)....
Transforms a disparity map into a set of 3D points.
Class for asynchronous transfer of image sets.
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.