16 #include <opencv2/opencv.hpp>
18 #include <visiontransfer/deviceenumeration.h>
19 #include <visiontransfer/imagetransfer.h>
20 #include <visiontransfer/imageset.h>
21 #include <visiontransfer/reconstruct3d.h>
28 #define snprintf _snprintf_s
31 using namespace visiontransfer;
38 if(devices.size() == 0) {
39 std::cout <<
"No devices discovered!" << std::endl;
48 std::cout <<
"Receiving image set..." << std::endl;
50 while(!imageTransfer.receiveImageSet(imageSet)) {
54 for (
int imageNumber=0; imageNumber < imageSet.
getNumberOfImages(); imageNumber++) {
56 cv::Mat convertedImage;
57 snprintf(fileName,
sizeof(fileName),
"image%d.pgm", imageNumber);
59 cv::imwrite(fileName, convertedImage);
60 std::cout <<
"Written " << fileName <<
" with OpenCV" << std::endl;
63 }
catch(
const std::exception& ex) {
64 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;