**1.安装树莓派上的系统**
2.安装ROS
3.安装编辑环境vscode
link
4.树莓派和电脑用网线连接 有无线可以略过这一步骤
link
5.树莓派串口的开启问题
link1
link2
link3
link4
6.ROS 目标检测
比较慢的安装方式:(好像有一些包没有,可以自啊后续出问题之后用git clone的方式从源码安装)
apt-get install ros-kinetic=object-recognition-kitchen-*
apt-get install ros-kinetic-object-recognition-core
源码:
git clone http://github.com/wg-perception/object_recognition_core
git clone http://github.com/wg-perception/linemod
git clone http://github.com/wg-perception/ork_renderer
git clone http://github.com/wg-perception/object_recognition_msgs
git clone http://github.com/wg-perception/object_recognition_ros
git clone http://github.com/wg-perception/object_recognition_ros_visualization
git clone http://github.com/wg-perception/object_recognition_core
cd ../ && catkin_make
如果出现缺少SDL/SDL.h
sudo apt-get install libsdl1.2-dev
7.依赖库
apt-get install meshlab
apt-get install libosmesa6-dev ``apt-get install python-pyside.qtcore
apt-get install python-pyside.qtgui
8.识别前的准备
- 建立物体模型库
apt-get install couchdb
curl -X get http://localhost:5984
rosrun object_recognition_core object_add.py -n "coke " -d "aaaa" --commit
屏幕出现 Stored new object with id: 802e14e8f037148208ab9941b1000ff1 - 然后我们在浏览器打开网页如下
http://localhost:5984/_utils/document.html?object_recognition/802e14e8f037148208ab9941b1000ff1
可以看到我们提交的记录
git clone https://github.com/wg-perception/ork_tutorials
- 添加我们的可口可乐模型
rosrun object_recognition_core mesh_add.py 802e14e8f037148208ab9941b1000ff1 /home/ubuntu/ork_tutorials/data/coke.stl --commit
- 查看添加的模型
pip install git+https://github.com/couchapp/couchapp.git
rosrun object_recognition_core push.sh
http://localhost:5984/or_web_ui/_design/viewer/meshes.html
- 训练
rosrun object_recognition_core training -c `rospack find object_recognition_linemod`/conf/training.ork
9.开启usb摄像头
roslaunch usb_cam usb_cam-test.launch
10.摄像头标定
roslaunch robot_vision usb_cam.launch
11.物体识别
apt-get install ros-kinetic-freenect-launch
roslaunch robot_vision freenect.launch
rosrun topic_tools relay /camera/depth_registered/image_raw /camera/depth_registered/image
rosrun object_recognition_core detection -c `rospack find object_recognition_linemod`/conf/detection.ros.ork
唉 放弃 ORK了 感觉对普通摄像机就没有相应的支持 官方文档都没有找到 书上和博客上只有那种深度摄像机和KINECT V2这种相机才有对应的教程 于是乎放弃摸索
roslaunch robot_vision ork_rviz.launch
12.opencv训练自己的分类器
看了一下face_detector.py的源码 感觉人脸的检测做的还是不错的 于是打算搞一个自己的分类器
看教程~ exe需要下载2.4.9的opencv 在opencv2.4.9\opencv\build\x86\vc12\bin
目录下面 你可以把整个bin文件拿出来 里面的DLL是依赖文件 不能丢 没有他们会报错
http://blog.topspeedsnail.com/archives/10511
训练的一些参数讲解
https://blog.csdn.net/u012905422/article/details/77478278
出现的错误:
Error: Assertion failed (_img.rows * _img.cols == vecSize)
这个网上也没有相应的答案 我的做法是看报错前的一段信息
PARAMETERS:
cascadeDirName: data
vecFileName: pos.vec
bgFileName: neg.txt
numPos: 80
numNeg: 100
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 24 看这里
sampleHeight: 24 看这里
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC
把-w -h都改成24
opencv_createsamples -info pos.txt -num 2000 -w 24 -h 24 -vec pos.vec
13.错误总结
ERROR: cannot launch node of type [robot_vision/face_detector.py]: can’t locate node [face_detector.py] in package [robot_vision]
权限问题 找到对应位置加个权限就好了
https://blog.csdn.net/banzhuan133/article/details/78177676?utm_source=blogxgwz0