kinect-v2

Crates.iokinect-v2
lib.rskinect-v2
version0.1.3
created_at2025-06-26 14:35:15.165933+00
updated_at2025-08-30 15:40:14.97454+00
descriptionA Rust binding for the Kinect V2 Windows SDK.
homepage
repositoryhttps://github.com/wangfu91/kinect-v2-rs
max_upload_size
id1727442
size94,228
Fu Wang (wangfu91)

documentation

README

Kinect V2 Rust Bindings 🦀🎮

kinect-v2:
Crates.io Docs License: MIT

kinect-v2-sys:
Crates.io Docs License: MIT


Kinect V2 Rust Bindings provide safe and idiomatic Rust access to the Kinect V2 Windows SDK, enabling you to capture color, depth, infrared, body, audio, and multi-source frames from your Kinect V2 sensor on Windows.

Note: This project currently supports Windows only. It uses the official Kinect V2 SDK, which is not available on other platforms. Future plans include cross-platform support using the libfreenect2 library.


Features ✨

  • Safe and idiomatic Rust API for Kinect V2
  • Access to color, depth, infrared, body, audio, and multi-source frames
  • Low-level FFI bindings to the official Kinect V2 SDK
  • Examples and documentation

Requirements ⚠️

  • Windows (Kinect V2 SDK is Windows-only)
  • Kinect V2 sensor and adapter
  • Kinect for Windows SDK 2.0 installed
  • Rust 1.70+ (2024 edition)

Getting Started 🚀

Add to your Cargo.toml:

[dependencies]
kinect-v2 = "0.1" # Replace with the latest version

Example Usage 📝

use kinect_v2::color_capture::ColorFrameCapture;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let color_capture = ColorFrameCapture::new()?;
    for frame_result in color_capture.iter()? {
        match frame_result {
            Ok(frame_data) => {
                println!("Color frame size: {}x{}, bytes: {}", frame_data.width, frame_data.height, frame_data.bytes.len());
            }
            Err(e) => {
                return Err(Box::new(e));
            }
        }
    }
    Ok(())
}

More examples can be found in the examples/ directory.

Building 🛠️

# Clone the repo
$ git clone https://github.com/wangfu91/kinect-v2-rs.git
$ cd kinect-v2-rs

# Build the project
$ cargo build --release

Project Structure 📁

  • kinect-v2/ — High-level, idiomatic Rust wrapper
  • kinect-v2-sys/ — Low-level FFI bindings to the Kinect V2 SDK

Roadmap 🗺️

  • Implement color frame capture
  • Implement depth frame capture
  • Implement infrared frame capture
  • Implement body frame capture
  • Implement audio frame capture
  • Implement multi-source frame capture
  • Publish to crates.io
  • Add more examples and documentation
  • Improve error handling and safety
  • Add tests for all features

Not Planned

  • Implement face detection features
  • Implement gesture recognition features
  • Cross-platform support using the libfreenect2 library

License 📄

MIT License. See LICENSE for details.

Acknowledgements 🙏


Feel free to open issues or PRs! Happy hacking! 🚀

Commit count: 102

cargo fmt