C++-class for grabbing both depth-images and RGB-images. Due to the varying quality of Kinects depth-reconstruction, a desired number of depth-frames can be taken an the mean of the valid depth-values is used as the resulting depth-value. To prevent outliers, the standard deviation is used as a threshold of valid values.
More...
#include <FrameGrabber.h>
Public Member Functions |
| FrameGrabber (unsigned int numberFrames, unsigned int sdThreshold=5.0) |
| Constructor of the FrameGrabber-class.
|
| ~FrameGrabber () |
| Destructor of the FrameGrabber-class.
|
bool | addFrame (uint16_t *depth) |
| Adds a Kinect depth-frame/image to the FrameGrabber-object.
|
void | addRgb (uint8_t *rgb) |
| Adds a Kinect RGB-frame/image to the FrameGrabber-object.
|
void | computeZValues () |
| Computes the z-values (depth-values) of the image as the mean of all valid depth-values per pixel. Depth-values, which standard deviation is higher than specified at the constructor are sorted out additional.
|
int * | getZValues () |
| Get the z-values (depth-values).
|
int * | getRgbValues () |
| Get the RGB-values.
|
bool * | getValidValues () |
| Get the indicators of valid values.
|
int | getValidCount () |
| Get the total number of valid values.
|
Private Member Functions |
float | computeSD (int index, int zMean, int validCount) |
| Computes the standard deviation of one pixel's depth-values over all frames.
|
Private Attributes |
unsigned int | numberFrames |
int | countFrames |
int | validCountTotal |
float | sdThreshold |
int | zValues [640 *480] |
int | rgbValues [640 *480 *3] |
bool | validValues [640 *480] |
int(* | frames )[640 *480] |
Detailed Description
C++-class for grabbing both depth-images and RGB-images. Due to the varying quality of Kinects depth-reconstruction, a desired number of depth-frames can be taken an the mean of the valid depth-values is used as the resulting depth-value. To prevent outliers, the standard deviation is used as a threshold of valid values.
- Author:
- Daniel Wunderlich (d.wunderlich@stud.uni-heidelberg.de)
- Version:
- 0.5
- Date:
- 2011-01-26
- See also:
- FrameGrabber
Constructor & Destructor Documentation
FrameGrabber::FrameGrabber |
( |
unsigned int |
numberFrames, |
|
|
unsigned int |
sdThreshold = 5.0 |
|
) |
| |
Constructor of the FrameGrabber-class.
- Parameters:
-
numberFrames | The number of depth-images (frames) should be taken. |
sdThreshold | Threshold for the maximum standard deviation of the z-values in each frame. If the threshold is exceeded, the z-value is not valid. |
- See also:
- framegrabber-section
FrameGrabber::~FrameGrabber |
( |
| ) |
|
Destructor of the FrameGrabber-class.
Member Function Documentation
bool FrameGrabber::addFrame |
( |
uint16_t * |
depth | ) |
|
Adds a Kinect depth-frame/image to the FrameGrabber-object.
- Parameters:
-
depth | Depth-image of Microsoft's Kinect as used in the glview-example of OpenKinect. |
- Returns:
- True, if the frame was added. False, if the number of desired frames specified at the constructor was already added.
void FrameGrabber::addRgb |
( |
uint8_t * |
rgb | ) |
|
Adds a Kinect RGB-frame/image to the FrameGrabber-object.
- Parameters:
-
rgb | RGB-image of Microsoft's Kinect as used in the glview-example of OpenKinect. |
float FrameGrabber::computeSD |
( |
int |
index, |
|
|
int |
zMean, |
|
|
int |
validCount |
|
) |
| [private] |
Computes the standard deviation of one pixel's depth-values over all frames.
- Parameters:
-
index | Index of the pixel. |
zMean | Mean of the pixel's valid z-values (depth-values). |
validCount | Number of the pixel's valid z-values. |
- Returns:
- Number of valid values.
void FrameGrabber::computeZValues |
( |
| ) |
|
Computes the z-values (depth-values) of the image as the mean of all valid depth-values per pixel. Depth-values, which standard deviation is higher than specified at the constructor are sorted out additional.
int * FrameGrabber::getRgbValues |
( |
| ) |
|
Get the RGB-values.
- Returns:
- int-Pointer to the -dimensional RGB-value-array.
int FrameGrabber::getValidCount |
( |
| ) |
|
Get the total number of valid values.
- Returns:
- Number of valid values.
bool * FrameGrabber::getValidValues |
( |
| ) |
|
Get the indicators of valid values.
- Returns:
- bool-Pointer to a -dimensional boolean-array, which indicates, if the depth-value at corresponding index is valid.
int * FrameGrabber::getZValues |
( |
| ) |
|
Get the z-values (depth-values).
- Returns:
- int-Pointer to the -dimensional depth-value array.
Field Documentation
Counts the number of frames already added to the FrameGrabber.
Buffer for all captured frames
Number of frames, which should be captured of the depth-stream.
Standard deviation threshold of valid depth-values.
Counts the total number of valid depth-values.
The documentation for this class was generated from the following files: