Region: Add convenience methods

Sometimes it's convenient to think in terms of width and height, other
times in terms of extents.  The addition of `right`, `bottom` and
`from_extents` to `Region` allow either model to be used as convenient.

These and the `_bounding_box` helper function will be useful for more
advanced uses of OCR which requires manipulating regions.
OCR: Support tesseract writing to files with any extension

The second argument to the tesseract command line tool is "output base"
which is a filename to which an extension will be appended.  Unfortunately
this extension varies depending on the arguments passed to tesseract and
even varies between different versions of tesseract[^1].

Using a temporary directory means that we don't need to know the extension
in advance and we can read the output independent of the extension that
tesseract appends.

[^1]: In hOCR mode tesseract 3.02 will write to base.html whereas 3.03 will
      write to base.hocr.
Refactor: _tesseract: Require that a frame to be passed in

This removes a dependency on `Display` from `_tesseract` making it a pure
function depending entirely on it's arguments and producing no
side-effects[^1].  This makes uses of it clearer.

[^1]: Or close enough.
Refactor: _tesseract: Allow passing a `Gst.Sample` as frame

This was originally written to allow getting the timestamp of frames being
passed to `_tesseract` allowing returning richer information.  This has not
yet been done but being able to pass a `GstSample` is still a nice thing to
be able to do.  It makes _tesseract more like the other image analysis
functions and has the pleasant side-effect of reducing copying.
OCR: Add ability to pass configuration to tesseract

tesseract has many configuration values controlling many aspects of the
OCR algorithm.  For instance `tessedit_char_whitelist` can be used to
only recognise certain charactors such as numbers and
`language_model_penalty_non_dict_word` controls the strength of the
dictionary.  Depending on the situation the user can use these to tailor
tesseract's algorithms to improve OCR accuracy.  This commit directly
exposes this configuration functionality/complexity to the user such that
they can set any configuration value.

Ideally we wouldn't expse this level of complexity to the user, but after
experimentation it seems that OCR is an inherently complex field, so this
commit directly exposes the controls that tesseract provide.  This is
better than us adding an additional layer of abstraction/obfuscation in
an attempt to make it simpler for the user.  Once we learn more about the
circumstances under which each configuration value is useful we can
publish recommendations in the documentation.
OCR: Add ability to pass user_patterns and user_words to tesseract

tesseract uses a dictionary to help choose the correct words from the
list of possibilities it produces.  This is helpful when reading real
words but can get in the way of reading serial numbers.

This commit allows the user to help tesseract by giving it hints about
the words it's reading.  This takes the form of adding words to
tesseract's dictionary and adding patterns for tesseract to recognise.

Unfortunately the pattern language is specific to tesseract, and while
it bears some resemblance to regexs the impedance mismatch between the
tesseract pattern language and regex is high enough that a mapping would
be impractical.  As a result the pattern language is exposed verbatim.
Documentation can be found in the tesseract source code[1].

[1]: https://code.google.com/p/tesseract-ocr/source/browse/trunk/dict/trie.h?spec=svn894&r=894#188
validate-ocr: Improve error reporting if no image is found
validate-ocr: Don't consider all `.txt` files as tests

Previously if you had a `README.txt` in your corpus directory validation
would fail as it was expecting a PNG image called `README`.
Fix running `make doc` on Travis

`make doc` on Travis prints:

    UnicodeEncodeError: 'ascii' codec can't encode characters in position
    416-423: ordinal not in range(128)

This commit tells pydoc that we're expecting UTF-8 on stdout so Unicode
strings should be encoded as UTF-8.  This fixes that issue but I'm
uncertain what else this will have fixed.  It seems like the right thing
to do anyway though.
documentation: Add OCR tips
Merge pull request #155 from wmanley/ocr-patterns

Expose tesseract configurability to allow users to specialize OCR for their use-cases