azurekinect标定文件_kinect2的标定

azurekinect标定⽂件_kinect2的标定
我⽤的是ubuntu14.04LTS,ROS 版本是indigo,kinect v2,我是⽤双系统装的ubuntu,关于怎么使⽤安装kinect2的安装以及使⽤的都在github上有着详细的说明
Kinect2 开源驱动:libfreenect2
kinect2--> ros的bridge:iai_kinect2
安装
安装libfreenect2,这个libfreenect2据说是它的驱动包,希望是稳定的,放在home⽬录下;
安装好libfreenect2的依赖项
sudo
apt-get install build-essential cmake pkg-config libturbojpeg
libjpeg-turbo8-dev mesa-common-dev freeglut3-dev libxrandr-dev libxi-dev
安装libusb
sudo apt-add-repository ppa:floe/libusb
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev
安装GLFW3
cd libfreenect2/depends
庚子之变
sh install_ubuntu.sh
sudo dpkg -i libglfw3*_3.0.4-1_*.deb
不要⽤sudo apt-get install安装glfw3,但可以⽤sudo apt-get remove libglfw3-dev卸载它。
所有以包形式安装的包都可以sudo apt-get remove来卸载它
接着编译库
cd ..
mkdir build && cd build
cmake ..
make
sudo make install
这时候插上kinect的数据线
运⾏lsusb,如果下⾯出现Bus 002 Device 003: ID 045e:02c4 Microsoft Corp.
Bus 002 Device 002: ID 045e:02d9 Microsoft Corp. 就说明连上了。
运⾏
./bin/Protonect
如果提⽰no device connected,是因为你的虚拟机默认设置是接usb2.0的⼝,⽽kinect v2要接usb3.0的⼝,所以要做出更改,但是⽤虚拟机装的ubuntu是连不上kinect的。
如果是要重装或是重新编译libfreenect2,则
cd
sudo rm -rf /usr/local/include/libfreenect2
cd /usr/local/lib
sudo rm -rf libfreenect2.so libfreenect2.so.0.2 libfreenect2.so.0.2.0
cd OpenNI2/Drivers
sudo rm -rf libfreenect2-openni2.so  libfreenect2-openni2.so.0
狗电影网站ROS接⼝安装
对于已经安装了Ros Indigo的Ubuntu14.04来说,使⽤下⾯的命令
cd ~/catkin_ws/src/
cd iai_kinect2
rosdep install -r --from-paths .
屋顶上的绿宝石主题曲
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE="Release"
rospack profile
rosdep install -r --from-paths .这⼀步可能会报错,但这个报错是正常的,不⽤管,不会影响最终结果。
接下来可以测试了。
新打开⼀个终端,运⾏
cd ~/catkin_ws/
catkin_make
source ./devel/setup.bash
cd src
roslaunch kinect2_bridge kinect2_bridge.launch
获取Kinect数据
再新打开⼀个终端,运⾏
rosrun kinect2_viewer kinect2_viewer
就可以正常显⽰图像了
⼀般在使⽤前 ,我们都会矫正,就是所谓的计算相机的内外参数,⼀般使⽤的⽅法都是张正友标定法的理论,理论知识就不在赘述,其实当时看都是能看懂的⼀旦让⾃⼰完全从头推理就懵逼了
⾸先呢我们的矫正步骤就是,我们得有标定模板,这如果你之前下载了iai_kinect2在kinect2_calibration⽂件下是有标定模板的  你可以随意打印⼀个模板等着后期的标定使⽤
那么我就按照github的教程教你如果去矫正kinect2  以下 就是github给出的具体的步骤,对于其中的参数我们⼀般按照要求给就OK了,对于kienct 2的标定并不需要说把红外发射器给遮住  然后使⽤红外LED去矫正的,这是针对kinect1的,之前我矫正过kinect1  确实是需要把红外发射装置给遮住,然后才能矫正深度信息,
Detailed steps:
If you haven't already, start the kinect2_bridge with a low number of frames per second (to make it easy on your CPU): rosrun kinect2_bridge kinect2_bridge _fps_limit:=2  (这⼀步就是要启动ROS的kienct 2的驱动货都kienct2的原始数据)
create a directory for your calibration data files, for example: mkdir ~/kinect_cal_data; cd ~/kinect_cal_data(这是为了创建⼀个⽂件,存储我们⽤于矫正的照⽚)
Record images for the color camera: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 record color  (这命令就是开始矫正深度相机的RGB相机,对于后⾯的参数我们可以知道chess5x7x0.03(是棋盘的⼤⼩  可以⽤尺⼦量⼀下的) record(记录保存下下) color)
Calibrate the intrinsics: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate color
Record images for the ir camera: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 record ir
Calibrate the intrinsics of the ir camera: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate ir
Record images on both cameras synchronized: rosrun kinect2_calibration kinect2_calibration chess
5x7x0.03 record sync Calibrate the extrinsics: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate sync图书馆论坛
Calibrate the depth measurements: rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate depth
c型卡环Find out the serial number of your kinect2 by looking at the first lines printed out by the kinect2_bridge. The line looks like this: device serial: 012526541941
Create the calibration results directory in kinect2_bridge/data/$serial: roscd kinect2_bridge/data; mkdir 012526541941
Copy the following files from your calibration directory (~/kinect_cal_data) into the directory you just created:
calib_color.yaml calib_depth.yaml calib_ir.yaml calib_pose.yaml
Restart the kinect2_bridge and be amazed at the better data.
通常遇到最多的就是这种问题,但是这个问题并不影响我们的矫正
[ERROR] Tried to advertise a service that is already advertised in this node
[/kinect2_calib_1458721837266890808/compressed/set_parameters]
[ERROR] Tried to advertise a service that is already advertised in this
node [/kinect2_calib_1458721837266890808/compressed/set_parameters]
真正影响我们的是我们输⼊的参数  ⽐如ROS的开发包给例⼦是使⽤棋盘格6*8的棋盘,正⽅形的边长为0.03⽶  但是我们的棋盘可能并并不是那么⼩的,这时候要使⽤我们的
棋盘的话就要注意给的参数了。⽐如⽤的是长有9个,款有7个正⽅形的标定棋盘,这时候我们的参数是6*8*0.05,参数⼀定要给准确,不然会出现错误的 啊、
⽽且就是在同⼀个⽂件下使⽤命令,

本文发布于:2024-09-23 14:23:58,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/288682.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:驱动   安装   标定
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议