sigproc/robotic_surgery — pull request #8 by rjw57 (2014-10-29 18:13:30+00:00)
Title: Face detect example

**NOTE**: this PR depends on #6 which should be merged before this one.

![screenshot from 2014-10-29 17 59 34](https://cloud.githubusercontent.com/assets/146860/4831569/73f3fb08-5f95-11e4-899c-8628dc712b5c.png)

This PR implements an example face detection pipeline using the Haar classifiers built into OpenCV. Please could everyone look at the *individual commits* in this PR rather than the combined changes.

Everyone should practise merging this branch into their local repo and test it. If you have no idea how to do this then contact me.

Conceptually, this is quite a simple problem: we have a ROS node which sits and listens for incoming images from somewhere, detects faces, and spits out the results. In actual fact there are some subtleties to this which is why I used this as an example. For a start, face detection cannot be done in real time. The face detector node, therefore, does some interesting tricks to make sure that images are dropped if we fall behind rather than simply being queued up.

I particularly direct your attention to a42270f. This commit adds a package which contains the custom message types we need to send face detection results around in ROS. ROS pre-compiles message types and so this *requires* that we build our ROS stack before testing. This is a new requirement since previously we have only been using runtime configuration files.

The Makefile target to build the stack is, unsurprisingly, ``build``. Under the covers it runs ``catkin_make`` in the container. If there are any arguments to pass to ``catkin_make``, set the ``CM_ARGS`` variable.

So, putting all of the above together, to test this PR you need to do the following:

Create a new branch, starting from ``master``:
```console
$ git branch face-detect-example master
```

Pull the changes from this PR:
```console
$ git pull https://github.com/rjw57/robotic_surgery face-detect-example
```

**VERY IMPORTANT** Build the stack:
```console
$ make build
```
Note that ``make delete_all_my_work`` will also delete any built files and so ``make build`` will need to be run again after a ``make delete_all_my_work``.

Test the launch file:
```console
$ make gui_launch LAUNCH=face_detect_example.launch PKG=face_detection
```

You should get a result similar to the screenshot above. (Minus my handsome face, of course.)

Please can everyone comment to confirm a) they have looked at the code, b) they'll use it as a template to start writing their own Python nodes and c) they have tested the code on their own machine.

Once everyone has done this *and* someone has merged #6, then I'll hit the Big Green Button.