RecFusion SDK
|
#include <Sensor.h>
Provides access to RGB-D sensors supported by RecFusion, use SensorManager for instantiation. More...
Provides access to RGB-D sensors supported by RecFusion, use SensorManager for instantiation.
Classes | |
struct | Format |
Structure representing the sensor format. More... | |
Public Member Functions | |
int | deviceName (char *name, int len) const |
Get sensor name. More... | |
int | uuid (char *name, int len) const |
Get sensor uuid. More... | |
int | depthFormatCount () |
Returns a number of depth stream formats supported by the sensor. More... | |
int | colorFormatCount () |
Returns a number of color stream formats supported by the sensor. More... | |
Format | depthFormat (int id) |
Get a depth stream format. More... | |
Format | colorFormat (int id) |
Get a color stream format. More... | |
bool | open (int colorWidth=640, int colorHeight=480, int depthWidth=640, int depthHeight=480, double maxFps=30) |
Open sensor. More... | |
bool | close () |
Close sensor. | |
bool | start () |
Start callback-based capture. | |
void | stop () |
Stop callback-based capture. | |
bool | isOpen () const |
Return true when sensor is open and ready for acquisition. | |
int | depthWidth () const |
Return width of depth image returned by sensor. | |
int | depthHeight () const |
Return height of depth image returned by sensor. | |
int | colorWidth () const |
Return width of color image returned by sensor. | |
int | colorHeight () const |
Return height of color image returned by sensor. | |
Mat3 | depthIntrinsics () const |
Return depth sensor intrinsics as 3x3 matrix. Returns zero matrix when no depth intrinsics are available. | |
Mat3 | colorIntrinsics () const |
Return color sensor intrinsics as 3x3 matrix. Returns zero matrix when no color intrinsics are available. | |
Mat4 | depthToColorTransformation () const |
Return depth to color transformation as 4x4 matrix. Returns zero matrix when no transformation is available. | |
bool | supportsColor () const |
Return true if sensor supports color. | |
bool | setLaserState (bool enable) |
Turn laser on or off. More... | |
bool | supportsAutoWhiteBalance () const |
Return true if sensor supports auto white-balance. | |
bool | setAutoWhiteBalanceEnabled (bool enable) |
Set auto white-balance state. More... | |
bool | isAutoWhiteBalanceEnabled () const |
Get auto white-balance state. | |
bool | supportsAutoExposure () const |
Return true if sensor supports auto exposure. | |
bool | setAutoExposureEnabled (bool enable) |
Set auto exposure state. More... | |
bool | isAutoExposureEnabled () const |
Get auto exposure state. | |
bool | setExposure (int exposureTimeMs) |
Set auto exposure to specified value in ms. Only works when auto exposure is disabled. | |
int | exposure () const |
Get exposure time in non-auto mode in ms. | |
void | addListener (SensorListener *listener) |
Register sensor listener. More... | |
void | removeListener (const SensorListener *listener) |
Remove previously registered sensor listener. More... | |
bool | readImage (DepthImage &imgDepth, ColorImage &imgColor, int timeOut=2000) |
Read image from sensor. More... | |
int deviceName | ( | char * | name, |
int | len | ||
) | const |
Get sensor name.
[out] | name | Output char buffer for sensor name. |
[in] | len | Output buffer length. |
int uuid | ( | char * | name, |
int | len | ||
) | const |
Get sensor uuid.
[out] | name | Output char buffer for sensor uuid. |
[in] | len | Output buffer length. |
int depthFormatCount | ( | ) |
Returns a number of depth stream formats supported by the sensor.
Returns 0 if available formats could not be queried. Must be called before depth formats can be queried.
int colorFormatCount | ( | ) |
Returns a number of color stream formats supported by the sensor.
Returns 0 if available formats could not be queried. Must be called before color formats can be queried.
Format depthFormat | ( | int | id | ) |
Get a depth stream format.
depthFormatCount must be called first.
id | Format ID in the range 0 to depthFormatCount-1 |
Format colorFormat | ( | int | id | ) |
Get a color stream format.
colorFormatCount must be called first.
id | Format ID in the range 0 to colorFormatCount-1 |
bool open | ( | int | colorWidth = 640 , |
int | colorHeight = 480 , |
||
int | depthWidth = 640 , |
||
int | depthHeight = 480 , |
||
double | maxFps = 30 |
||
) |
Open sensor.
Must be called before any other functions can be used.
colorWidth | Desired color image width. |
colorHeight | Desired color image height. |
colorHeight | Desired color image height. |
depthWidth | Desired depth image width. |
depthHeight | Desired depth image height. |
maxFps | Maximum framerate to use. |
bool setLaserState | ( | bool | enable | ) |
Turn laser on or off.
enable | True to enable, false to disable laser |
bool setAutoWhiteBalanceEnabled | ( | bool | enable | ) |
Set auto white-balance state.
enable | True to enable, false to disable auto white-balance |
bool setAutoExposureEnabled | ( | bool | enable | ) |
Set auto exposure state.
enable | True to enable, false to disable auto exposure |
void addListener | ( | SensorListener * | listener | ) |
Register sensor listener.
listener | Sensor listener |
void removeListener | ( | const SensorListener * | listener | ) |
Remove previously registered sensor listener.
listener | Sensor listener |
bool readImage | ( | DepthImage & | imgDepth, |
ColorImage & | imgColor, | ||
int | timeOut = 2000 |
||
) |
Read image from sensor.
The images passed in need to be allocated by the caller.
imgDepth | Pointer to depth image of size width() x heigt(). Will contain depth measurements in mm for valid pixels and zero for other pixels upon return. |
imgColor | Pointer to depth image of size width() x heigt(). Will contain color image in RGB-format upon return. |
timeOut | Time out to wait for data in ms. |