16 #include <opencv2/opencv.hpp> 18 #include <visiontransfer/deviceenumeration.h> 19 #include <visiontransfer/imagetransfer.h> 20 #include <visiontransfer/imagepair.h> 21 #include <visiontransfer/reconstruct3d.h> 28 #define snprintf _snprintf_s 38 if(devices.size() == 0) {
39 std::cout <<
"No devices discovered!" << std::endl;
48 std::cout <<
"Receiving image..." << std::endl;
50 while(!imageTransfer.receiveImagePair(imagePair)) {
54 cv::Mat image0, image1;
57 cv::imwrite(
"image0.png", image0);
58 cv::imwrite(
"image1.png", image1);
59 std::cout <<
"Written image0.png and image1.png with OpenCV" << std::endl;
61 }
catch(
const std::exception& ex) {
62 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 toOpenCVImage(int imageNumber, cv::Mat &dest, bool convertRgbToBgr=true)
Converts one image of the pair to an OpenCV image.
Class for synchronous transfer of image pairs.
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.