ReconstructMe SDK  1.0.726-75385
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups
Viewing

Detailed Description

This module provides basic inline viewing capatibilities for debugging purposes. You should not rely on this functionality in production code. It is meant for debugging and rapid prototype purposes. Viewing will lower the performance of the system. See the example below for basic usage

// Create a new context
// Compile for OpenCL device using defaults
// Create a new volume
// Create a new sensor. Tries multiple backends using default
// sensor configurations, returns the first working one. By default
// each sensor works on the first volume created.
reme_sensor_create(c, "openni;mskinect;file", true, &s);
// For debugging purposes open a viewer for tracking the reconstruction process.
// This will create a two-sided viewer showing the video stream and the current
// reconstruction from the sensor point of view.
reme_viewer_t viewer;
reme_viewer_create_image(c, "This is ReconstructMe SDK", &viewer);
// Perform reconstruction until no more frames are left
int time = 0;
while (time < 200 && REME_SUCCESS(reme_sensor_grab(c, s))) {
// Prepare image and depth data
// Try to determine updated sensor position.
// On succes, update volume, otherwise move to a recovery position
// and wait for the tracking to start again.
if (REME_SUCCESS(reme_sensor_track_position(c, s))) {
// Update volume with depth data from the
// current sensor perspective
}
// Update the viewer
reme_viewer_update(c, viewer);
time += 1;
}
// Close and destroy the sensor, it is not needed anymore
// Create a new surface
reme_surface_save_to_file(c, m, "test.ply");
// Visualize resulting surface
reme_viewer_t viewer_surface;
reme_viewer_create_surface(c, m, "This is ReconstructMeSDK", &viewer_surface);
reme_viewer_wait(c, viewer_surface);
// Make sure to release all memory acquired

Typedef Documentation

typedef int reme_viewer_t

Handle referencing a viewer object.

Basic viewing of sensor and reconstruction outputs is provided through this SDK as an debugging functionality. You should not rely on its presence, as it might get dropped in later versions of this SDK.

Function Documentation

reme_error_t reme_viewer_create_image ( reme_context_t  c,
const char *  title,
reme_viewer_t v 
)

Create viewer for viewing multiple images.

Parameters
cA valid context object
titleWindow title
vA pointer to the resulting viewer object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_recorder.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, example_reconstructmesdk_surface.cpp, and example_reconstructmesdk_volume.cpp.
reme_error_t reme_viewer_create_surface ( reme_context_t  c,
reme_surface_t  s,
const char *  title,
reme_viewer_t v 
)

Create viewer for specific surface.

In order to work properly this method should be called for a non-empty surface.

Parameters
cA valid context object
sA valid surface object
titleWindow title
vA pointer to the resulting viewer object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_one_minute.cpp, and example_reconstructmesdk_surface.cpp.
reme_error_t reme_viewer_destroy ( reme_context_t  c,
reme_viewer_t v 
)

Destroy a previously created viewer object.

Parameters
cA pointer to a valid context object
vA mutable pointer to a valid viewer handle to destroy
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
reme_error_t reme_viewer_add_image ( reme_context_t  c,
reme_viewer_t  v,
reme_sensor_t  s,
reme_sensor_image_t  i 
)

Add image to be displayed.

Parameters
cA valid context object
vA valid viewer object
sA valid sensor object
iThe type of image to add from sensor
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_recorder.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, example_reconstructmesdk_surface.cpp, and example_reconstructmesdk_volume.cpp.
reme_error_t reme_viewer_update ( reme_context_t  c,
reme_viewer_t  v 
)

Update viewer content.

Updates the content of the given viewer for a single frame.

Parameters
cA valid context object
vA valid viewer object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_recorder.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, example_reconstructmesdk_surface.cpp, and example_reconstructmesdk_volume.cpp.
reme_error_t reme_viewer_wait ( reme_context_t  c,
reme_viewer_t  v 
)

Update viewer content until the user closes the viewer.

Blocks the calling thread until the user closes the viewer.

Parameters
cA valid context object
vA valid viewer object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_one_minute.cpp, and example_reconstructmesdk_surface.cpp.