Content
This example shows how to access images generated by sensor objects. Additionally to ReMe it uses OpenCV to display them for the sake of simplicity of this example.
Boost is only used to generate examples and is not necessary for working with this SDK.
#include <boost/test/unit_test.hpp>
#include <opencv2/opencv.hpp>
#include <stdio.h>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(image)
{
int width, height, nchans;
int counter = 0;
{
if (counter % 30 == 0) {
char buffer[50];
sprintf (buffer, "image_%i.png", counter);
printf("Saved image (%ix%i - %i channels) to %s \n", width, height, nchans, buffer);
}
counter += 1;
}
}
BOOST_AUTO_TEST_CASE(image_external)
{
const void *data;
int width, height, length;
{
cv::Mat rgb(height, width, CV_8UC3, (char*)data);
cv::Mat bgr;
cv::cvtColor(rgb, bgr, CV_RGB2BGR);
cv::imshow("RGB", bgr);
cv::waitKey(10);
}
}
BOOST_AUTO_TEST_SUITE_END()