use kinectv2 on ubuntu 16.04 with libfreenect2

  1. download openni2. I download the develop branch

git clone https://github.com/occipital/OpenNI2.git -b develop

and then do as this article https://blog.csdn.net/seamanj/article/details/78261669 told.

  1. download libfreenect2
    https://github.com/OpenKinect/libfreenect2

please make sure it can find openni2 when you cmake.

when you make, it might have some problems.

try to solve it by this way:

On Ubuntu 16, I had the same issue. Here is how it got fixed. Hope it helps
Step 1:
Install libjpeg-turbo8-dev
Step 2:
The libturbojpeg.so file was missing so I had to create a sym-link.
I ran sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so
Step 3:
Deleted the build directory and ran cmake again.

https://github.com/OpenKinect/libfreenect2/issues/36

then go to bin dir and run
sudo ./Protonect

在這裏插入圖片描述

in the lib folder, make sure the file libfreenect2-openni2.so is generated.

在這裏插入圖片描述

and copy all these files into /home/seamanj/Software/OpenNI2/Bin/x64-Release/OpenNI2/Drivers

and then run NiViewer

在這裏插入圖片描述

If u got some problems, please make sure you use the right openni2 libraries. you can check from the cmake configure. Before I use libOpenNI2.so from /usr/lib (Maybe I copied to this folder before), which makes me unable to open .oni file.
在這裏插入圖片描述

And don’t forget copy the libfreenect2 driver to the corresponding folder. Here, my openni2 lib path is “/home/seamanj/Software/OpenNI2/Packaging/OpenNI-Linux-x64-2.3/Redist/libOpenNI2.so”, so I will copy the libfreenect2 drivers to “/home/seamanj/Software/OpenNI2/Packaging/OpenNI-Linux-x64-2.3/Redist/OpenNI2/Drivers”

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章