templatematch: implement getter for the property debugDirectory

This was causing a warning to appear in gst-inspect.
'stbt run' times out when the gstreamer pipeline fails to start

Add a timeout to prevent stbt run from hanging when the gtk main loop is
started but nothing is received from the bus.

Note that the timeout is now effective from the call to the gtk main
loop, and not from the first buffer received (so the timeout may need to
be set slightly (1 second) longer?)

Note that when we restart the pipeline on underrun, we now reset the
wait_for_match / wait_for_motion timeout.
Limit the maximum attempts to restart the pipeline in case of underrun

In some cases, due to the capture driver, the pipeline was restarted
infinitely.
README: "templatematch" GStreamer element is now "stbt-templatematch"

As of commit 0d588c3.
Fix test configuration file

The size of videotestsrc depended on the capabilities set in the sink
pipeline.

As the tests using videotestsrc require videotestsrc to have a specific
dimension, the dimensions is explicitly set in the test configuration
file.
Disable debug output by default; add --verbose flag

`stbt run -v` behaves just like `stbt run` behaved before this commit.

`stbt run -vv` also enabled the debugDirectory property of the
stbt-templatematch GStreamer element. This will dump all intermediate
images from the templatematch algorithm for each frame processed.

We might want to add a similar debugDirectory property to the
stbt-motiondetect element.
Give the GStreamer pipeline 2 seconds to start up before restarting

(instead of 1 second).

The underrun detection aims to restart the source pipeline, and
therefore the Hauppauge HD PVR capture device, when that device stops
sending any video (see commit b6135ec for details).

Sometimes one second doesn't give the pipeline enough time to start up
the very first time. This is a bit hacky; maybe we need to treat the
very first underrun differently.
Bash-completion script: Complete "--help"

We already completed the "--help" in "stbt --help", but not in "stbt run
--help" and "stbt record --help".
motiondetect: debugDirectory property to debug the motiondetect algorithm

By setting the debugDirectory property of the element stbt-motiondetect,
it is possible to capture intermediate steps of the motiondetect
algorithm.

This will save two images to the debugDirectory for every frame
processed: The unmodified frame, and the absDiff between the current &
previous frame.
`stbt run -vv` enables debug of stbt-motiondetect

`stbt run -vv` now also sets the debugDirectory property of the
stbt-motiondetect GStreamer element to "stbt-debug/motiondetect".

The stbt-templatematch debugDirectory is also moved from "stbt-debug"
to "stbt-debug/templatematch".
Remove excessive `stbt run -v` underrun-handler debug

This debug output is now available with `stbt run -vv` (two vees).

The debug when we actually stop & restart the pipeline is still visible
at `-v`, but the wording has been made more user-friendly.
templatematch: Cleanup - Remove unused image
templatematch: Cleanup - Fix warnings
templatematch: Cleanup - Prevent memory leaks

Memory leaks could have happened if set_caps was called several time.
templatematch: Make the matching algorithm more robust

In some cases, the algorithm reported false positives or false negatives.

False positives were reported with large template images that differed in
small parts of the source images. The second pass of the algorithm was not
executed as the first pass of the algorithm provided a great confidence.
To solve this problem, the second pass is now always executed.

False negatives were reported with large template images (at least 100px on
one side) that had some parts with no edges detected. The template match
did not report a match when comparing two black images.
Other false positives were reported by the algorithm with large template
images that differed in small parts of the source images. This depended on
the split points chosen by the second pass.
To solve these two problems, the second pass has been improved and is now
much simpler. The absolute difference between the template image and the
source image is computed. To account for noise, the result is thresholded
and eroded. If the template is different enough, some white blobs will
remain.
templatematch: Cleanup - Fix coding conventions breakage
templatematch: Cleanup - Make the code clearer

Note that when setting a new template image, the lock to filter is now held
a bit longer.

Holding the lock longer is not important as the only other part of the code
that could be delayed is the template match algorithm. It is fair to assume
that when setting a new template image, we are not concerned about delaying
a templatematch that would have otherwise used a non interesting template.
Makefile: Treat warnings as errors
Remove the parameter certainty from wait_for_match and press_until_match

As the second pass of the template matching algorithm is now returning a
binary result: match / no match, the parameter certainty was not actually
used and was misleading.

With the improved template matching algorithm, the certainty is either 1
for match or below 0.80 for no_match.
Correct exit status for failing self-tests

Without this, `make check` didn't detect failing self-tests.