1. 程式人生 > >libfreenect 在ubuntu 上的安裝

libfreenect 在ubuntu 上的安裝

是什麼?

主頁:https://github.com/OpenKinect/libfreenect2

一句話描述:KInect  V2的驅動程式。

程式支援的功能:

  • RGB 影象轉換
  • 紅外和深度影象轉換
  • RGB和深度影象的校正

 

開發者:OpenKinect

開發者主頁:https://openkinect.org/wiki/Main_Page

OpenKinect  是使用 kinect 裝置的開源組織,超過2000個成員,最近做出了  libfreenect 專案。

 

某些功能特性所需的

  • OpenGL 3.1
  • OpenCL 1.1
  • CUDA

問題解決頁面: https://github.com/OpenKinect/libfreenect2/wiki/Troubleshooting

 

驅動安裝流程(以 ubuntu 16.04為例)

  1. 下載原始碼
  2. git clone https://github.com/OpenKinect/libfreenect2.git
    cd libfreenect2

    2.安裝編譯工具

    sudo apt-get install build-essential cmake pkg-config

     

  3. 安裝 libusb
    sudo apt-get install libusb-1.0-0-dev

    4.安裝 TurboJPEG

  4. sudo apt-get install libturbojpeg libjpeg-turbo8-dev

    5.安裝 OpenGL

  5. sudo apt-get install libglfw3-dev

    6.安裝OpenCL(可選)

  6. AMD GPU:

  7. Install the latest version of the AMD Catalyst drivers from        https://support.amd.com

  8. and

  9.  apt-get install opencl-headers.

     

    INTEL GPU: 

  10. sudo apt-get install beignet-dev

     

    7. 安裝CUDA(可選,只適用於Nvidia)

  11.  

  12. 8. 安裝VAAPI (節選,只適用於intel) 

  13.            VA-API is an open source libray and API specification,which provides access to graphics hardware acceleration capabilities for video processing. It consists of a main library and driver-specific acceleration backends for each supported hardware vendor.  (視訊處理過程中的硬體加速)

  14. Reference resources:https://www.freedesktop.org/wiki/Software/vaapi

  15. sudo apt-get install libva-dev libjpeg-dev

    9. OpenNI2(可選)

  16. sudo apt-get install libopenni2-dev

    10.編譯(在libfreenect 根目錄下)

  17. mkdir build && cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
    make
    make install

    執行以下確保第三方應用找到libfreenect2

    cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2

    11.  複製硬體規則

  18. sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/

    12 .測試

  19. 插入Kinect,執行 

    ./bin/Protonect