ReconstructMe SDK  2.6.43-0
Real-time 3D reconstruction engine
Viewing

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

Typedefs

typedef int reme_viewer_t
 Handle referencing a viewer object. More...
 
reme_error_t reme_viewer_create_image (reme_context_t c, const char *title, reme_viewer_t *v)
 Create viewer for viewing multiple images. More...
 
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. More...
 
reme_error_t reme_viewer_create_volume (reme_context_t c, reme_volume_t vol, reme_sensor_t s, const char *title, reme_viewer_t *v)
 Create viewer for specific volume. More...
 
reme_error_t reme_viewer_destroy (reme_context_t c, reme_viewer_t *v)
 Destroy a previously created viewer object. More...
 
reme_error_t reme_viewer_add_image (reme_context_t c, reme_viewer_t v, reme_image_t i)
 Add image to be displayed. More...
 
reme_error_t reme_viewer_update (reme_context_t c, reme_viewer_t v)
 Update viewer content. More...
 
reme_error_t reme_viewer_is_closed (reme_context_t c, reme_viewer_t v, bool *closed)
 Test if the viewer is closed. More...
 
reme_error_t reme_viewer_wait (reme_context_t c, reme_viewer_t v)
 Update viewer content until the user closes the viewer. More...
 

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, "librealsense", 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);
// Reconstruct until viewer is closed, or grabbing fails. Note that
// aborting reconstruction just because a single grab failed is not good stlye.
// You should allow for multiple grab attempts.
printf("Starting reconstruction. Close the viewer window to stop.\n");
bool viewer_done = false;
while (!viewer_done && 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.
// Update volume with depth data from the
// current sensor perspective
}
// Update the viewer
reme_viewer_update(c, viewer);
reme_viewer_is_closed(c, viewer, &viewer_done);
}
// 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);
// Print pending errors
// Make sure to release all memory acquired

Typedef Documentation

◆ reme_viewer_t

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_viewer_create_image()

◆ reme_viewer_create_surface()

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_bust.cpp, example_reconstructmesdk_colorize.cpp, example_reconstructmesdk_marker.cpp, example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_point_and_shoot_with_colors.cpp, example_reconstructmesdk_remote_reconstruction.cpp, example_reconstructmesdk_sensor_multi_independent.cpp, and example_reconstructmesdk_surface.cpp.

◆ reme_viewer_create_volume()

reme_error_t reme_viewer_create_volume ( reme_context_t  c,
reme_volume_t  vol,
reme_sensor_t  s,
const char *  title,
reme_viewer_t v 
)

Create viewer for specific volume.

Directly renders the volume content and allows camera manipulation similar to reme_viewer_create_surface. If colorization is supported, the content is rendered using the recorded colors. Otherwise, the content is rendered using normalmap shading.

On average this viewer requires less memory to render than reme_viewer_create_surface, plus is can be updated in real-time. This allows real-time visualization of volume changes. By using manipulating the camera position the entire volume can be inspected in real-time.

The initial camera position is chosen so that the entire volume (not only its content, but its bounds) is in view. The resolution and the view frustum is defined by the intrinsic parameters delivered by the provided sensor.

Parameters
cA valid context object
volA valid volume object
sA valid sensor object
titleWindow title
vA pointer to the resulting viewer object
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_colorize.cpp, example_reconstructmesdk_csg.cpp, and example_reconstructmesdk_sensor_external.cpp.

◆ reme_viewer_destroy()

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_viewer_add_image()

◆ reme_viewer_update()

◆ reme_viewer_is_closed()

reme_error_t reme_viewer_is_closed ( reme_context_t  c,
reme_viewer_t  v,
bool *  closed 
)

Test if the viewer is closed.

Parameters
cA valid context object
vA valid viewer object
closedA pointer to a boolean receiving the closed status
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_color_tracking.cpp, example_reconstructmesdk_one_minute.cpp, example_reconstructmesdk_remote_reconstruction.cpp, and example_reconstructmesdk_sensor_external.cpp.

◆ reme_viewer_wait()