# ros_detection **Repository Path**: T_Geek/ros_detection ## Basic Information - **Project Name**: ros_detection - **Description**: Objects detection ROS pakage based on OpenCV::dnn. - **Primary Language**: C++ - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-07-06 - **Last Updated**: 2022-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ros_detection [![](https://img.shields.io/badge/TGeek-project-blue.svg)](47.93.7.151) ![rospass]() Objects detection ROS pakage based on OpenCV::dnn. **Authot**: Michael.Chen **Website**: www.tgeek.tech [English](./README.md) --- ## 要求 ROS::Kinect, OpenCV with OpenCV_contrib no less than 3.3. ## 文件描述 #### build/ : 编译空间 #### devel/ : 开发空间 #### src/ : 源码空间 : ##### detector/ : detector ROS包 ######dnn_nets/ : 网络结构,标签,预训练模型 - yolo/ -Yolo 配置文件 - ssd/ -SSD 配置文件 ###### include:头文件 - DetectorNode.hpp - dnndetector.hpp ###### msg/: mesages for ROS ###### param/: configurations - param_config.xml -视频流配置 - dnn_param.xml -神经网络配置 ###### src/ : 源码 - listener/ -订阅器 - talker/ -发布器 video/ : 测试视频文件夹 ###### package.xml: 包描述文件 ###### CMakeLists.txt : cmake 配置文件 ##### CMakeLists.txt : 包 cmake 配置文件 ## 安装 ### 配置 Cmake Configure```CMakeLists.txt ``` ```bash gedit CMakeLists.txt ``` 多版本OpenCV设置路径,否则注释此行 ```cmake #if u have OpenCV version more than one, set the build path which one u want to use set(OpenCV_DIR "YOUR_PATH") ``` Ex: ```cmake #if u have OpenCV version more than one, set the build path which one u want to use set(OpenCV_DIR "/home/test/app/opencv-3.4.0/build/") ``` ### 编译 **确保在工作空间** ```bash $ catkin_make ``` ## 运行 打开一个ros master ```bash $ roscore ``` 打开新终端,**确保当然工作空间在顶部** ```bash $ source devel/setup.sh #(option, if workspace not on top) $ rosrun detector detector_node ``` ![](http://tgeek.tech/wp-content/uploads/2019/08/Detection_screenshot_01.08.2019-e1564644184728.png) ### 可选: Listener 订阅器 如果想监听消息,可以打开一个订阅器 消息为: [时间戳] [检测到物体类别] [检测到物体置信度] [检测到物体中心点坐标] 打开新终端,**确保当然工作空间在顶部** ```bash $ rosrun detector listener ``` ![](http://tgeek.tech/wp-content/uploads/2019/08/2019-08-01-22-50-04-的屏幕截图-e1564644199321.png) ## 使用 ### 视频流配置 **不需要重新编译** 视频路径为 {ROS_Package Path}/video/{VIdeo Name} ```xml 1 1 0 1 test.mp4 1 1280 720 ``` ### Network configurations **不需要重新编译** 网络文件为 {ROS_Package Path}/dnn/{File Name} ```xml Configration<--> 1 0-ssd 1-yolo<--> 0.35 confidence threshold<--> 0.25 nms threshold<--> Yolo configration files<--> 1 0.003921569 /dnn_nets/yolo/yolov3-tiny.cfg /dnn_nets/yolo/yolov3-tiny.weights /dnn_nets/yolo/coco.names ssd configration files<--> 127.5 0.007843 /dnn_nets/ssd/deploy.prototxt /dnn_nets/ssd/mobilenet_iter_73000.caffemodel /dnn_nets/ssd/ssd.names ```