GuidedFilter  1.2.0
 Hosted by GitHub
Classes | Enumerations | Functions | Variables
guidedFilter_kinect_point_cloud.cpp File Reference

An example showcasing the effect of the Guided Filter algorithm on depth images. More...

#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <chrono>
#include <mutex>
#include <GL/glew.h>
#include <CLUtils.hpp>
#include <GuidedFilter/algorithms.hpp>
#include <GL/glut.h>
#include <libfreenect.hpp>
Include dependency graph for guidedFilter_kinect_point_cloud.cpp:

Classes

class  CLEnvGL
 Creates an OpenCL environment with CL-GL interoperability. More...
 
class  GFilterPC
 Applies Guided Image Filtering on a Kinect RGB frame and delivers the data to OpenGL. More...
 
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...
 

Enumerations

enum  Stream : uint8_t { Stream::RGB, Stream::DEPTH }
 

Functions

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
 
GLuint glRGBBuf
 
GLuint glDepthBuf
 
Freenect::Freenect freenect
 
MyFreenectDevicedevice
 
double freenectAngle = 0
 
float focalLength = 595.f
 
const std::vector< std::string > kernel_files
 
const int imgWidth = 640
 
const int imgHeight = 480
 
const int dRadius = 5
 
const float dEps = 0.02f
 
const float dScaling = 1e-3f
 
GFilterPCgFilter
 

Detailed Description

An example showcasing the effect of the Guided Filter algorithm on depth images.

This example demonstrates the performance of the Guided Image Filtering algorithm on a live video stream. It processes the Kinect RGB and Depth streams in OpenCL with the GuidedFilter pipeline. Then, it creates a point cloud and displays it in an OpenGL window.

Author
Nick Lamprianidis
Version
1.2.0
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.

Enumeration Type Documentation

enum Stream : uint8_t
strong
Enumerator
RGB 
DEPTH 

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.

Variable Documentation

float angleX = 0.f
float angleY = 0.f
const float dEps = 0.02f
const int dRadius = 5
const float dScaling = 1e-3f
float focalLength = 595.f
Freenect::Freenect freenect
double freenectAngle = 0
GFilterPC* gFilter
const int gl_win_height = 480
const int gl_win_width = 640
GLuint glDepthBuf
GLuint glRGBBuf
int glWinId
const int imgHeight = 480
const int imgWidth = 640
const std::vector<std::string> kernel_files
Initial value:
= { "kernels/imageSupport_kernels.cl",
"kernels/scan_kernels.cl",
"kernels/transpose_kernels.cl",
"kernels/boxFilter_kernels.cl",
"kernels/math_kernels.cl",
"kernels/guidedFilter_kernels.cl",
"kernels/examples_kernels.cl" }
int mouseX = -1
int mouseY = -1
float zoom = 1.f