Giter VIP home page Giter VIP logo

libfreenect's Introduction

(cvk) libfreenect with REGISTERED-mode record/playback in fakenect

This is a fork of libfreenect which includes REGISTERED-mode record/playback in fakenect.

Normally, an application using libfreenect requests either 11BIT or REGISTERED mode when initializing freenect, which determines the output format of depth frames. 11BIT mode means that the depth frames contain the Kinect’s raw 11-bit depth reading value at each pixel. REGISTERED mode means that these depth values are converted to millimeters (to avoid having to store floating-point data), and then the depth frame is aligned to the RGB frame based on the depth camera’s intrinsics. (The conversion from 11BIT to REGISTERED is done in software by libfreenect, not in Kinect hardware.)

The fakenect distrubuted with libfreenect only supports playback in 11BIT mode (with depth frames not registered to RGB frames). This custom fork allows the depth images to be recorded in 11BIT mode as normal, but then played back in either 11BIT or REGISTERED mode.

The fakenect in this fork saves registration data in the same output directory as the depth/RGB/accelerometer frames in a file called registration. This file is required for playback in REGISTERED mode.

The code to save the Kinect’s registration data to a file (and reload it) came from here:

There is also a standalone registration dumper included in this fork:

$ fakenect_dump_registration <savefile>

Testing

To make sure that this code works as expected, there is a ruby script which captures screenshots from a depth/RGB stream viewer using "live" libfreenect data and recorded fakenect data. If REGISTRED mode record/playback works as intended, these images should appear virtually identical to a human. The script also saves an RGB image which can be compared to the depth gradients to test alignment.

Some test images are here:

How to install

See the original libfreenect readme below.

How to record depth/RGB/accelerometer data from the Kinect

$ record <recording_dir>

e.g.:

$ record office_recording1

How to run fakenect

$ fakenect <recording_dir> command line

e.g.:

$ fakenect office_recording1 glview

More READMEs

The fakenect README can be found here:

Stuff that follows this paragraph is the original libfreenect README.

libfreenect

Ongoing Development and Maintenance by the OpenKinect Community

  • Original Code and Engineering: Hector Martin (marcan)

  • Community Lead: Josh Blake (JoshB)

  • Integration: Kyle Machulis (qDot)

Description

libfreenect is the core library for accessing the Microsoft Kinect USB camera. Currently, the library supports access to:

  • RGB and Depth Images

  • Motors

  • Accelerometer

  • LED

Audio is currently being worked on.

Information Resources

Information about the OpenKinect project can be found at

For questions, support, and discussion, check out the google groups mailing list at

Or the IRC channel at

#openkinect on Freenode

We are also on twitter at

Requirements

For the driver, you’ll need

  • libusb-1.0 >= 1.0.3 (*nix and OS X)

  • libusb-win32 (Windows)

  • Cmake >= 2.6 (All platforms)

For the glview sample, you’ll need

  • OpenGL

  • glut

  • pthreads (Either platform provided or pthread-win32 for windows)

For links to the software listed, see http://openkinect.org/wiki/Getting_Started#Dependencies

See the platform specifics section for other information specific to the platform you may be working on.

Basic Compiling Instructions

To use CMake:

  • Make a directory somewhere. Like, say, 'build' in your repo directory.

  • Go into that directory

  • Type cmake ..

  • Watch the magic happen

  • After this, just run make and you’ll be fine.

  • If you want to use an IDE or whatever, well, you’ll figure it out.

Platform Specifics

OS X

Note
AS OF 2010-11-16, WE HAVE UPDATED THIS PATCH. IF YOU HAVE ALREADY PATCHED, PLEASE REPATCH AND REINSTALL LIBUSB TO GET OS X WORKING AT FULL 30FPS.

You will need to pull the matching version of libusb for this patch. This is NOT v1.0.8, this is a change based off the repo head as of 2010-10-16. To get a tar.gz with the snapshot of the repo at this point, hit the link below.

Once you’ve gotten that tarball and unziped it somewhere, patch using the files in platform/osx/. Just go to the root directory of the libusb source and run

patch -p1 < [path_to_OpenKinectRepo]/platform/osx/libusb-osx-kinect.diff

You need to tell configure to include some necessary frameworks: ./configure LDFLAGS='-framework IOKit -framework CoreFoundation'

Recompile libusb and put it wherever CMake will look (/usr/local/lib, /usr/lib, etc…​). If you’re using a package manager like fink, macports, or homebrew, I’m going to expect you know what your doing and can deal with this. If not, see IRC channel.

OpenGL and GLUT come as prebuilt frameworks with OS X, so that should do it for requirements.

Linux

Should "just work" if you have the following packages installed:

  • libusb-1.0-dev

If you want to see the glview example:

  • freeglut3-dev (or whatever freeglut dev package your distro has)

  • libxmu-dev

  • libxi-dev

udev rules are available in the platform/linux directory so that you are not required to run as root.

Windows

Windows support is now available in libfreenect. The inf files in the platform/windows directory can be used for installing the device, and the library will need libusb-win32 to compile.

Wrappers

libfreenect has interface to several languages. Look in the wrappers/ directory for them:

  • C (using a synchronous API)

  • python

  • actionscript

  • C#

  • Java (JNA)

Licensing

The libfreenect project is covered under a dual Apache v2/GPL v2 license. The licensing criteria are listed below, as well as at the top of each source file in the repo.

This file is part of the OpenKinect Project. http://www.openkinect.org

Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB
file for details.

This code is licensed to you under the terms of the Apache License,
version 2.0, or, at your option, the terms of the GNU General Public
License, version 2.0. See the APACHE20 and GPL2 files for the text of
the licenses, or the following URLs:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.txt

If you redistribute this file in source form, modified or unmodified,
you may:

- Leave this header intact and distribute it under the same terms,
  accompanying it with the APACHE20 and GPL2 files, or
- Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
- Delete the GPL v2 clause and accompany it with the APACHE20 file

In all cases you must keep the copyright notice intact and include a
copy of the CONTRIB file.

Binary distributions must follow the binary distribution requirements
of either License.

libfreenect's People

Contributors

zarvox avatar marcan avatar qdot avatar lostinspacebar avatar slomp avatar mrenouf avatar imekinox avatar amiller avatar joshblake avatar cvonkleist avatar algrs avatar kairibu avatar mmwise avatar nbourdau avatar netpro2k avatar floe avatar kelvie avatar richmattes avatar yoda-jm avatar edaubert avatar jkerdels avatar pkropf avatar stevenlovegrove avatar stephanemagnenat avatar timn avatar tfoote avatar yarikoptic avatar arnebe avatar thomasroefer avatar oftheo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.