- All image processing and face recognition functionalities are provided by utilizing the Shervin Emami's c++ source code for face recognition (http://www.shervinemami.info/faceRecognition.html).
- License: Attribution-NonCommercial 3.0 Unported (http://creativecommons.org/licenses/by-nc/3.0/)
The face_recognition ROS package provides an simple actionlib server interface for performing different face recognition functionalities in video stream.
This instalation process is for catkin (ROS Groovy or newer version) Assuming that your catkin workspace is under ~/catkin_ws, if not replace ~/catkin_ws with appropriate location. It also assumes you're running Bash shell, if you're running Zsh, source appropriate setup.zsh file.
cd ~/catkin_ws/src
git clone https://github.com/procrob/procrob_functional.git --branch catkin
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
This message includes 2 fields:
order_id = 0
order_id = 1
order_id = 2 and order_argument = person_name
order_id = 3
order_id = 4
confidence_value (double, default = 0.88)
show_screen_flag (boolean, default = true)
add_face_number (int, default = 25)
Details in http://www.shervinemami.info/faceRecognition.html
The name of persons and the images of their faces to train from are stored in the train.txt file. This file should be in the same directory as where you execute the program. See the example train.txt file for the desirable format of the train.txt (Note: the person numbers start from 1, spaces or special characters are not allowed in persons' names). The program trains from the train.txt file and stores the eigenfaces data in facedata.xml file.
When the face_recognition actionlib server is executed (Fserver), the program first tries to load data from the facedata.xml file if exists, if not it will try to learn from training images stored in train.txt if any. You can always add training data directly from the video stream using the add_face_images goal (order_id = 2). Note: when program retrains (order_id = 3), the content of facedata.xml is disregarded and the program trains only based on the train.txt file.
For demonstration purposes an actionlib client example for the face_recognition simple actionlib server has been provided. The client subscribes to face_recognition/FRClientGoal messages. Each FRClientGoal message contains an order_id and an order_argument which specify a goal to be executed by the face_recognition server. After receiving a message, the client sends the corresponding goal to the server. By registering relevant call back functions, the client receives feedback and result information from the execution of goals in the server and prints such information on the terminal.
roscore
rosrun usb_cam usb_cam_node usb_cam_node/image_raw:=camera/image_raw _image_height:=<usb_cam_height> _image_width:=<usb_cam_width>
rosrun face_recognition Fserver
rosrun face_recognition Fclient
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 2 "your_name"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 3 "none"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 1 "none"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 2 "your\_friend's\_name"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 0 "none"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 1 "none"
rostopic pub -1 /fr_order face_recognition/FRClientGoal -- 4 "none"