A C++ library to access and manipulate Kinect data easily.
Report a bug or request a feature
- 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 folderlibs
at the root of the project that contains a folderfreeglut
. This directory should contain the foldersbin
,lib
andinclude
of the freeglut library.
Follow the instructions above, then clone the repo (git clone https:://github.com/torresflo/Kinect-Lab.git
) and build the project.
You can have a look at main.cpp
or see the example below.
#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);
//...
}
//...
}
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU General Public License v3.0. See LICENSE
for more information.