Object Detection using OpenCV and ROS Interface
This package includes an object detection framework which can be used with ROS for any robot application you prefer.
- ROS Kinetic
- OpenCV 2.4.9
- ROS usb_cam driver (should also work with libuvc)
The package has been tested with Ubuntu 16.04, ROS Kinetic and OpenCV 2.4.9 using the usb_cam driver package.
- Install ROS: see instructions here
- Setup the ROS environment
- download and install OpenCV and cam driver packages.
- run
catkin build
- source
source devel/setup.bash
- start the usb cam driver, e.g.
rosrun usb_cam usb_cam_node
- start the object detector using
rosrun color_detector color_detector
- to see the output via ROS you could use a GUI e.g.
rqt_image_view
or direct line commandrosrun image_view image_view image:=/object_detector/image_treshold
Basically the object detector can either output the thresholded image or the contour image (or both if you want). Therefore, two topics are essential
/object_detector/image_treshold
outputs the tresholded image with parameters width=640
, height=480
, step=640
, encoding="mono8"
/object_detector/contour_treshold
outputs the contour image with parameters width=640
, height=480
, step=640
, encoding="mono8"
Always ensure that the usb_cam driver is running before you start the object detector node.