This is a ROS node which reads images from a given directory, detects faces, and publishes the images with the detected faces encircled, to the sensor_msgs/Image
topic which can be subscribed by Rviz for visualisation.
-
Install Rviz
1. Download or clone the package into your catkin workspace
Open a new terminal and source your environment setup file by typing the following:
$ source /opt/ros/%your_distro%/setup.bash
From your catkin workspace, enter the following:
$ catkin_make
$ source ./devel/setup.bash
If you do not have OpenCV-2 versions installed, edit the find_package line in CMakeLists.txt.
Open a new terminal and run roscore. Do not forget to source the environmental setup file in each of the new terminals.
$ roscore
Open another terminal and run the code with arguments as shown below.
$ rosrun face_detector imag_pub.py <OpenCV dir> <Database dir>
Use another terminal to open rviz.
$ rosrun rviz rviz
Setup your rviz to subscribe to images from the sensor_msgs
topic
Watch the working here
Find the documentation link at face_detection_documentation/documentation/index.html