ReconstructMe SDK
1.0.726-75385
Real-time 3D reconstruction engine
|
The sensor is responsible for acquiring real world data and feeding it into the reconstruction volume. See the example below for basic usage.
typedef int reme_sensor_t |
Handle referencing a sensor object.
A reme_sensor_t represents a RGBD sensor. Associated methods allow to create, open and interact with sensors of various types.
typedef enum _reme_sensor_image_t reme_sensor_image_t |
Image type enumeration.
Each sensor might provide different frame types that are all 2D images. Not all sensors support all frames, or the number of frames supported is configuration dependant.
enum _reme_sensor_image_t |
Image type enumeration.
Each sensor might provide different frame types that are all 2D images. Not all sensors support all frames, or the number of frames supported is configuration dependant.
reme_error_t reme_sensor_create | ( | reme_context_t | c, |
const char * | driver, | ||
bool | require_can_open, | ||
reme_sensor_t * | s | ||
) |
Create a new sensor object.
Creates a new sensor. The driver argument specifies which sensor to open. The following sensor drivers are currently available
You might specify a specific driver
Alternatively you can specify a list of drivers to test, in which case it will return the first sensor that works.
Or, specify file paths of a serialized sensor messages (don't forget to escape backslashes).
The drivers will be tested in the given order.
Set require_can_open to true to ensure the created sensor can be created and opened using either the default settings, or if file paths are specifed using the settings specified in the file.
No matter how require_can_open is set the sensor is returned in closed state. Use reme_sensor_open to open it.
c | A valid context object |
driver | The name of sensor driver to instance a sensor from |
require_can_open | Ensures that the returned sensor can be opened using either the default sensor options. |
s | A pointer that will receive the handle of the created sensor |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_destroy | ( | reme_context_t | c, |
reme_sensor_t * | s | ||
) |
Destroy a previously created sensor object.
c | A pointer to a valid context object |
s | A mutable pointer to a valid sensor handle to destroy |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_open | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Open a sensor.
Attempts to opens the specified sensor using the specified sensor options.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_close | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Close a an open sensor.
Indicates that no more grabbing is done from sensor. Re-opening a sensor is possible.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_set_volume | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
reme_volume_t | v | ||
) |
Set the working volume.
The sensor will use this volume to keep track of its position and it will also update into this volume. By default the sensor is assigned to the first volume available.
c | A valid context object |
s | A valid sensor object |
v | A valid volume object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_bind_camera_options | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
reme_options_t | o | ||
) |
Access the sensor specific options.
For openni sensors
For mskinect sensors
For file sensors
Common to all configurations above is the depth_intrinsics field. It is mendatory for reconstruction and has the following structure
c | A valid context object |
s | A valid sensor object |
o | A valid options binding object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_bind_track_options | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
reme_options_t | o | ||
) |
Access the sensor track options.
c | A valid context object |
s | A valid sensor object |
o | A valid options binding object. |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_get_position | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
const float ** | coordinates | ||
) |
Get the sensor position with respect to the world coordinate frame.
Initially this is set to identity for all sensors. The position is modified when reme_sensor_track_position succeeds, or reme_sensor_set_position is called.
The returned coordinates pointer remains valid until the sensor is destroyed. The pointer is recycled internally, which means that it will point to different values each time the sensor position has changed.
c | A valid context object |
s | A valid sensor object |
coordinates | A mutable pointer to constant Transform data. |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_get_incremental_position | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
const float ** | coordinates | ||
) |
Get the incremental movement of the sensor.
When reme_sensor_track_position succeeds this position reflects the movement of the sensor between the last position of the sensor and the current position of the sensor.
The returned coordinates pointer remains valid until the sensor is destroyed. The pointer is recycled internally, which means that it will point to different values each time the sensor position has changed.
c | A valid context object |
s | A valid sensor object |
coordinates | A mutable pointer to constant Transform data. |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_set_position | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
const float * | coordinates | ||
) |
Set the sensor position with respect to the world coordinate frame.
Initially this is set to identity for all sensors.
c | A valid context object |
s | A valid sensor object |
coordinates | A pointer to constant Transform data. |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_set_incremental_position | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
const float * | coordinates | ||
) |
Set the incremental movement of the sensor.
Updates the world position of the sensor by the incremental position specified.
c | A valid context object |
s | A valid sensor object |
coordinates | A pointer to constant Transform data. |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_reset | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Resets the sensor to identity position.
Forces the sensor to loose track.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On tracking success or the corresponding volume is empty. |
REME_ERROR_UNSPECIFIED | is returned otherwise. |
reme_error_t reme_sensor_get_image_size | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
_reme_sensor_image_t | i, | ||
int * | width, | ||
int * | height | ||
) |
Get a specific sensor image width and height.
Returns the image dimensions width and height. The sensor needs to be open for this method to complete successfully (see reme_sensor_open).
c | A valid context object |
s | A valid sensor object |
i | Image type to access |
width | Width of image in pixels |
height | Height of image in pixels |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_get_image | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
_reme_sensor_image_t | i, | ||
const void ** | bytes, | ||
int * | width = 0 , |
||
int * | height = 0 , |
||
int * | num_channels = 0 , |
||
int * | num_bytes_per_channel = 0 , |
||
int * | row_stride = 0 |
||
) |
Get a specific sensor image.
Each sensor might provide different frame types. Not all sensors support all frames, or the number of frames supported is configuration dependant. See reme_sensor_image_t for a complete enumeration of available image types.
The returned bytes pointer remains valid until the sensor is destroyed or the dimension of the image changes. The pointer is recycled internally, which means that it will point to different values each time the sensor images are updated.
c | A valid context object |
s | A valid sensor object |
i | Image type to access |
bytes | A mutable pointer to constant pixel data. |
width | Width of image in pixels |
height | Height of image in pixels |
num_channels | Number of channels per pixel |
num_bytes_per_channel | Number of bytes per channel |
row_stride | Distance between successive rows in bytes |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_get_track_time | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
int * | track_time | ||
) |
Get the tracking time.
The tracking time corresponds to the number of frames in which tracking succeeded. In case tracking fails the counter gets negative.
c | A valid context object |
s | A valid sensor object |
track_time | The tracking time |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_grab | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Trigger frame grabbing.
Provides a synchronization point to trigger image generation of all image types. This method is intended to be fast.
In order to synchronize frame grabbing from multiple sensors, call this method in sequence for each sensor before calling reme_sensor_retrieve.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_FAILED_TO_GRAB | Failed to grab from sensor. This is not necessarily an error, you might re-try. |
REME_ERROR_UNSPECIFIED | Is returned otherwise. |
reme_error_t reme_sensor_prepare_images | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Retrieve image data corresponding to the previous grab command for further processing.
Updates the internal state of all images and prepares the required data structures on the computation device.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_prepare_image | ( | reme_context_t | c, |
reme_sensor_t | s, | ||
_reme_sensor_image_t | i | ||
) |
Retrieve specific image data for subsequent processing.
In case REME_IMAGE_AUX or REME_IMAGE_DEPTH is passed, this method will fetch the data into internal memory. In case REME_IMAGE_VOLUME is passed, the previously prepared REME_IMAGE_DEPTH will be uploaded to the computation device for subsequent processing (reme_sensor_track_position, reme_sensor_update_volume).
This method is especially useful (when compared to reme_sensor_prepare_images) when only depth and image data is required. For example when recording, there is no need for REME_IMAGE_VOLUME and it should be skipped so no time is wasted waiting for the data to be uploaded to the computation device.
c | A valid context object |
s | A valid sensor object |
i | Image type to prepare |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |
reme_error_t reme_sensor_track_position | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Attempts to track the sensor position.
Tries to track the sensor movement by matching the current depth data against the perspective from the last position. Initially the sensor position is the identity position, unless otherwise specified.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On tracking success or the corresponding volume is empty. |
REME_ERROR_TRACK_LOST | When the tracking did not succeed. In this case the sensor is repositioned into latest recovery pose. |
REME_ERROR_INVALID_LICENSE | is returned when tracking is disabled for a certain amount of time because of running in a non-commercial mode. |
REME_ERROR_UNSPECIFIED | is returned otherwise. |
reme_error_t reme_sensor_update_volume | ( | reme_context_t | c, |
reme_sensor_t | s | ||
) |
Update the bound volume using the current sensor data.
Uses the current sensor position as the perspective to update the volume.
c | A valid context object |
s | A valid sensor object |
REME_ERROR_SUCCESS | On success |
REME_ERROR_UNSPECIFIED | On failure |