0
$\begingroup$

Rosanswers logo

Hi!

I seem to be confused about using face_detection in my custom bot. I have an RPi camera and want to use it to detect faces. I found one here. And I also found this neat face_detector package. Can someone please show me how this can be done? I'm running my ROS kinetic on raspbian and raspberry pi v3.

I want my camera to detect faces and at the same time, display the results using Rviz in my ros-enabled remote computer.


Originally posted by Nelle on ROS Answers with karma: 21 on 2018-08-14

Post score: 0


Original comments

Comment by PeteBlackerThe3rd on 2018-08-14:
What are you wanting to see in RVIZ? What type of information do you want to know about the detected face? 2D bounding box? 2D centre? Cropped image?

Comment by Nelle on 2018-08-14:
Can I have both 2D bounding box and 2D centre? Sorry, not very familiar with face detection though. And I have just started with ROS as well.

Comment by Nelle on 2018-08-14:
Also can I make the raspicam_node show entire image stream? I mean continuously like what the face_detector does?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are two steps to get this working, getting the raspicam node up and running then getting the face detection node working.

If I remember rightly the raspicam node is a little unusual in that you have to send a start service request to it before it will publish any images. This makes sense on a Pi so you can conserve processing power when you don't need the images. When you have this node up and running and you can view the image stream on RVIZ on your remote computer then you're ready to move onto step two.

The face_detection node you linked to is designed to work with stereo cameras so it's not suitable for use with just a raspberry pi camera, however the face_detection_tracking package does work with monocular camera images and also produces the same bounding box overlay you're looking for. Running this node on your remote computer will spare the CPU of the Pi and result in a faster detection frequency.

When this node is running there will be a new image topic you can view in RVIZ that will highlight any detected faces.

Hope this gets you going in the right direction.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-08-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Nelle on 2018-08-15:
Thanks! One more question, how can I view the images on RViz in a remote computer? Should I just ssh into the pi? Or would ROS master/slave work?

Comment by PeteBlackerThe3rd on 2018-08-15:
ROS is a fundamentally distributed system if you look at this tutorial you can see how to setup your environment variables to use a multi-computer system. When this is working, RVIZ on the remote computer can subscribe to an image topic published

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.