简体   繁体   English

libfreenect2 是否支持 Kinect v2

[英]Does libfreenect2 support Kinect v2

I have to work with the Kinect v2 in Linux for a project and am searching for compatible libraries.我必须在 Linux 中使用 Kinect v2 来完成一个项目,并且正在搜索兼容的库。 It is unclear as to whether the Open Kinect project has cracked the Kinect v2 yet.目前还不清楚 Open Kinect 项目是否已经破解了 Kinect v2。

Yes, this library is for the kinect v2.是的,这个库适用于 kinect v2。 This library (libfreenect2) does not work with the older kinect (360) for which you would use libfreenect此库 (libfreenect2) 不适用于您将使用 libfreenect 的旧 kinect (360)

Read the project page here: https://github.com/OpenKinect/libfreenect2在这里阅读项目页面: https : //github.com/OpenKinect/libfreenect2

Yes, it supports Kinect V2, and you can install it from here https://github.com/OpenKinect/libfreenect2是的,它支持 Kinect V2,你可以从这里安装它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.如果你需要在 Linux 中从 Kinect V2 接收这些数据,有一些 OpenNI 和 NiTE 的驱动程序可以让你从 Kinect 接收这些数据。 Please take a look at this thread for more information: https://github.com/OpenKinect/libfreenect2/issues/243请查看此线程以获取更多信息: https : //github.com/OpenKinect/libfreenect2/issues/243

Yes libfreenect2 works for and onl for the Kinect V2.是的,libfreenect2 仅适用于 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.但重要的是要知道 Kinect v2 仅适用于 USB 3.0(或更多我猜),如果您想在同一网络上使用多个 kinect,您可能会遇到一些问题。 here you can find the API.在这里你可以找到 API。 Moreover you can take a look at this for some help.此外,您可以查看this以获得一些帮助。 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.注册-> 在彩色图像上应用重新映射深度图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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