ReconstructMe SDK  2.0.819-89134
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
example_reconstructmesdk_sensor.cpp

Content

Shows how to work with sensors.

Boost is only used to generate examples and is not necessary for working with this SDK.

#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(sensor)
{
// Create a new context
// Create any sensor
reme_sensor_create(c, "mskinect", true, &s);
// Access camera properties and disable rgb and enable ir stream
reme_options_create(c, &o_cam);
reme_options_set(c, o_cam, "aux_stream.type", "STREAM_IR");
// Open the sensor. This takes camera options into account.
reme_options_create(c, &o_cap);
// Bind the capture options. See documentation of this method for a list of properties available.
// Read frame size of auxilary image (IR).
bool supported;
int width, height;
reme_options_get_bool(c, o_cap, "frame_info.supports_aux", &supported);
reme_options_get_int(c, o_cap, "frame_info.aux_size.width", &width);
reme_options_get_int(c, o_cap, "frame_info.aux_size.height", &height);
printf("Auxilary supported: %s (%i x %i)", supported ? "true" : "false", width, height);
// Grab image. Synchronizes all image streams.
// Prepare just the auxilary image
// Get the image
// Visualize image and wait for user to close viewer
reme_viewer_create_image(c, "Auxilary Image", &v);
// Here we modify the position of the tilt-angle of the Microsoft Kinect for Windows camera.
// We clear all values before indicating that we are just interesting in setting the tilt angle
// and no other value.
reme_options_clear(c, o_cap);
reme_options_set_int(c, o_cap, "tilt_angle", 0);
// Apply capture properties
// Close sensor communication
// Destroy sensor
// Print pending errors
// Make sure to release all memory acquired
}
BOOST_AUTO_TEST_SUITE_END()