RandomBallCover  1.2.1
 Hosted by GitHub
Classes | Functions | Variables
kinect_frame_grabber.cpp File Reference

Grabs and stores in binary files an RGB and a Depth Kinect frame. More...

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <mutex>
#include <GL/glew.h>
#include <GL/glut.h>
#include <libfreenect.hpp>
Include dependency graph for kinect_frame_grabber.cpp:

Classes

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...
 

Functions

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 ()
 
int main (int argc, char **argv)
 

Variables

const int gl_win_width = 640
 
const int gl_win_height = 480
 
int glWinId
 
int mouseX = -1
 
int mouseY = -1
 
float angleX = 0.f
 
float angleY = 0.f
 
float zoom = 1.f
 
bool frame_taken = false
 
int frame_id = 0
 
GLuint glRGBBuf
 
GLuint glDepthBuf
 
Freenect::Freenect freenect
 
MyFreenectDevicedevice
 
double freenectAngle = 0.0
 

Detailed Description

Grabs and stores in binary files an RGB and a Depth Kinect frame.

Author
Nick Lamprianidis
Version
1.2.1
Date
2015
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.

Function Documentation

void drawGLScene ( )

Display callback for the window.

void idleGLScene ( )

Idle callback for the window.

void initGL ( int  argc,
char **  argv 
)

Initializes GLUT.

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.

void printInfo ( )
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.

Variable Documentation

float angleX = 0.f
float angleY = 0.f
int frame_id = 0
bool frame_taken = false
Freenect::Freenect freenect
double freenectAngle = 0.0
const int gl_win_height = 480
const int gl_win_width = 640
GLuint glDepthBuf
GLuint glRGBBuf
int glWinId
int mouseX = -1
int mouseY = -1
float zoom = 1.f