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

Provides basic inline viewing capatibilities for debugging purposes. More...

Typedefs

typedef int reme_viewer_t
 Handle referencing a viewer object.
 
reme_error_t reme_viewer_create_image (reme_context_t c, const char *title, reme_viewer_t *v)
 Create viewer for viewing multiple images.
 
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.
 
reme_error_t reme_viewer_destroy (reme_context_t c, reme_viewer_t *v)
 Destroy a previously created viewer object.
 
reme_error_t reme_viewer_add_image (reme_context_t c, reme_viewer_t v, reme_image_t i)
 Add image to be displayed.
 
reme_error_t reme_viewer_update (reme_context_t c, reme_viewer_t v)
 Update viewer content.
 
reme_error_t reme_viewer_wait (reme_context_t c, reme_viewer_t v)
 Update viewer content until the user closes the viewer.
 

Detailed Description

Provides basic inline viewing capatibilities for debugging purposes.

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.
reme_viewer_t viewer;
reme_viewer_create_image(c, "This is ReconstructMe SDK", &viewer);
reme_image_t volume, aux;
reme_image_create(c, &volume);
reme_viewer_add_image(c, viewer, aux);
reme_viewer_add_image(c, viewer, volume);
// 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
printf("Now generating the mesh.\n");
printf("Note that this will take at least 20 seconds without a valid license.\n");
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);
// Print pending errors
// 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 
)
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_colorize.cpp, example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, example_reconstructmesdk_sensor_multi_independent.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_image_t  i 
)
reme_error_t reme_viewer_update ( reme_context_t  c,
reme_viewer_t  v 
)
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_colorize.cpp, example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, example_reconstructmesdk_sensor.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, and example_reconstructmesdk_surface.cpp.