Skip to content

A C++ library to access and manipulate Kinect data easily.

License

Notifications You must be signed in to change notification settings

torresflo/Kinect-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license PRs Welcome GitHub contributors GitHub issues

Kinect Lab

A C++ library to access and manipulate Kinect data easily.
Report a bug or request a feature

Table of Contents

Getting Started

Prerequisites

  • The project is supposed to be compiled on Visual Studio.
  • The Kinect for Windows SDK 1.8 should be installed on your computer. The project's configuration files will use the environment variable $(KINECTSDK10_DIR) to search for the includes and the libs. This variable should be set automatically when installing the SDK.
  • The file main.cpp is using OpenGL and freeglut. Create a folder libs at the root of the project that contains a folder freeglut. This directory should contain the folders bin, lib and include of the freeglut library.

Installation

Follow the instructions above, then clone the repo (git clone https:://github.com/torresflo/Kinect-Lab.git) and build the project.

Usage

You can have a look at main.cpp or see the example below.

Example

#include <KinectCore\Kinect\Sensor.hpp>

Kinect::Sensor sensor;
Kinect::Error lastError = sensor.init(); //Init the sensor, you can precise an index if you have multiple devices connected

if (lastError == Kinect::Error::NoError)
{
    lastError = sensor.update();
    
    //Let's retrieve information from the sensor
    const Container::Array2D<Math::Scalar8UC3>& colorImage = sensor.getColorImage(); //2D Array of (R, G, B) values
    const Container::Array2D<Math::Scalar32FC3>& depthImage = sensor.getDepthImage(); //2D Array of depth values in millimeters
    const Container::Array2D<unsigned short>& playersIndex = sensor.getPlayersIndex(); //2D Array of players index (from 1 to 6).
    
    std::vector<Kinect::Skeleton> skeletons = sensor.getSkeletons(); //Vector of available skeletons
    for(const Kinect::Skeleton& skeleton : skeletons)
    {
        const Math::Vector3f& headPosition = skeleton.getPosition(Kinect::SkeletonPosition::Head);
        const Math::Vector3f& handLeftPosition = skeleton.getPosition(Kinect::SkeletonPosition::HandLeft);
        //...
    }
    //...
}

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

Releases

No releases published

Packages

No packages published

Languages