Grabs and stores, in a binary file, an 8-D point cloud from a Kinect RGB and Depth frame.
More...
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <mutex>
#include <ctime>
#include <GL/glew.h>
#include <CLUtils.hpp>
#include <GuidedFilter/algorithms.hpp>
#include <GL/glut.h>
#include <libfreenect.hpp>
|
class | MyFreenectDevice |
| A class that extends Freenect::FreenectDevice by defining the VideoCallback function so we can be getting updates with the latest RGB frame. More...
|
|
|
void | saveBinary (std::vector< uint8_t > &rgb, std::vector< uint16_t > &depth) |
| Stores the given Kinect frames in binary files. More...
|
|
void | drawGLScene () |
| Display callback for the window. More...
|
|
void | idleGLScene () |
| Idle callback for the window. More...
|
|
void | resizeGLScene (int width, int height) |
| Reshape callback for the window. More...
|
|
void | keyPressed (unsigned char key, int x, int y) |
| Keyboard callback for the window. More...
|
|
void | mouseMoved (int x, int y) |
| Mouse callback for the window. More...
|
|
void | mouseButtonPressed (int button, int state, int x, int y) |
| Mouse button callback for the window. More...
|
|
void | initGL (int argc, char **argv) |
| Initializes GLUT. More...
|
|
void | printInfo () |
| Displays the available controls. More...
|
|
std::string | getArgument (int argc, char **argv, std::string flag) |
| Retrieves command line arguments. More...
|
|
void | configure (int argc, char **argv) |
| Configures parameters. More...
|
|
int | main (int argc, char **argv) |
|
Grabs and stores, in a binary file, an 8-D point cloud from a Kinect RGB and Depth frame.
- Note
- Command line arguments:
-
-s <name>
: suffix for the name of the binary file.
-
-f
: enable Guided Image Filtering.
-
Example usage:
-
./bin/kinect_frame_grabber -s test_1 -f
-
to filter the frames, and store the point cloud in
../data/kg_pc8d_test_1.bin
- Author
- Nick Lamprianidis
- Version
- 2.0
- Date
- 2015
- Copyright
- The MIT License (MIT)
- Copyright (c) 2015 Nick Lamprianidis
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
void configure |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Configures parameters.
- Parameters
-
[in] | argc | command line argument count. |
[in] | argv | command line arguments. |
Display callback for the window.
std::string getArgument |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
std::string |
flag |
|
) |
| |
Retrieves command line arguments.
- Parameters
-
[in] | argc | command line argument count. |
[in] | argv | command line arguments. |
[in] | flag | argument to look for (-s , -f ). |
- Returns
- A string with the argument value.
Idle callback for the window.
void initGL |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
void keyPressed |
( |
unsigned char |
key, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Keyboard callback for the window.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
void mouseButtonPressed |
( |
int |
button, |
|
|
int |
state, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Mouse button callback for the window.
void mouseMoved |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Mouse callback for the window.
Displays the available controls.
void resizeGLScene |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
Reshape callback for the window.
void saveBinary |
( |
std::vector< uint8_t > & |
rgb, |
|
|
std::vector< uint16_t > & |
depth |
|
) |
| |
Stores the given Kinect frames in binary files.
Freenect::Freenect freenect |
double freenectAngle = 0.0 |
const int gl_win_height = 480 |
const int gl_win_width = 640 |