# 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 [中文](./README_cn.md) --- ## Requirments ROS::Kinect, OpenCV with OpenCV_contrib no less than 3.3. ## Files discription #### build/ : build space #### devel/ : Devel space #### src/ : source space : ##### detector/ : detector package ######dnn_nets/ : The configration, labels and pre-trained model of networks - yolo/ -Yolo Configurations - ssd/ -SSD Configurations ###### include:head files - DetectorNode.hpp - dnndetector.hpp ###### msg/: massages for ROS ###### param/: configurations - param_config.xml -configuration of video stream - dnn_param.xml -configuration of dnn ###### src/ : source code - listener/ -source of listener - talker/ -source of the main functions video/ : test video folder ###### package.xml: discription file of package ###### CMakeLists.txt : cmake configration ##### CMakeLists.txt : cmae configration of the package ## installation ### Configure Cmake Configure```CMakeLists.txt ``` ```bash gedit CMakeLists.txt ``` if you have OpenCV version more than one, uncommit and change line9,set the build path which one you want to use. ```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/") ``` ### Compile make sure you are in the **ROS catkin workspace**. ```bash $ catkin_make ``` ## Run Open a terminal and run the ros master ```bash $ roscore ``` Open a new terminal. **Set this workspace on top!** ```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) ### Option: Listener If you want to hear the message from the detctor_node. Run the listener node massages: [time stemp] [detected object type] [detected object confidence] [detected object center positon] Open a new terminal. **Set this workspace on top!** ```bash $ rosrun detector listener ``` ![](http://tgeek.tech/wp-content/uploads/2019/08/2019-08-01-22-50-04-的屏幕截图-e1564644199321.png) ## Usage ### Video stream configurations **Do not need to re-compile** videl_file location is {ROS_Package Path}/video/{VIdeo Name} ```xml 1 1 0 1 test.mp4 1 1280 720 ``` ### Network configurations **Do not need to re-compile** network files location is {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 ```