简体   繁体   中英

Does libfreenect2 support Kinect v2

I have to work with the Kinect v2 in Linux for a project and am searching for compatible libraries. It is unclear as to whether the Open Kinect project has cracked the Kinect v2 yet.

Yes, this library is for the kinect v2. This library (libfreenect2) does not work with the older kinect (360) for which you would use libfreenect

Read the project page here: https://github.com/OpenKinect/libfreenect2

Yes, it supports Kinect V2, and you can install it from here https://github.com/OpenKinect/libfreenect2

However, remember it doesn't give you joint and skeleton information. If you need to receive those data from Kinect V2 in Linux, there is some drivers for OpenNI and NiTE which let you receive those from Kinect. Please take a look at this thread for more information: https://github.com/OpenKinect/libfreenect2/issues/243

Yes libfreenect2 works for and onl for the Kinect V2. But the important thing to know is that the Kinect v2 work ONLY with USB 3.0 (or more I guess) and you can have some problem if you want to use several kinect on the same network. here you can find the API. Moreover you can take a look at this for some help. The most import part of the code are the following lines :

    #include "libfreenect2/libfreenect2.hpp"
    #include "libfreenect2/frame_listener_impl.h"
    #include "libfreenect2/registration.h"

    libfreenect2::Freenect2 freenect2;
    libfreenect2::Freenect2Device *dev = nullptr;
    libfreenect2::SyncMultiFrameListener *listener;
    libfreenect2::Registration* registration;

        listener = new libfreenect2::SyncMultiFrameListener(libfreenect2::Frame::Color | libfreenect2::Frame::Depth);
        dev->setColorFrameListener(listener);
        dev->setIrAndDepthFrameListener(listener);

        dev->start();
        registration = new libfreenect2::Registration(dev->getIrCameraParams(), dev->getColorCameraParams());

and then in a loop :

libfreenect2::FrameMap frames;
        libfreenect2::Frame undistorted(512, 424, 4), registered(512, 424, 4), depth_remap(1920, 1082, 4);

        listener->waitForNewFrame(frames);
        //capture
        libfreenect2::Frame *bgrx = frames[libfreenect2::Frame::Color];
        libfreenect2::Frame *depth = frames[libfreenect2::Frame::Depth];

        registration->apply(bgrx, depth, &undistorted, &registered, true, &depth_remap);

registration->apply remap the depth map on the color image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM