Adaptively threshold unwarped markers

This patch significantly improves the reliability of the extraction of
codes from unwarped markers.  Unwarped markers were being thresholded
'globally' (i.e. one threshold was applied against all the pixels of
the image) with a threshold that had been calculated using a heuristic
that attempted to balance the number of white and black pixels.

Now, as with the thresholding of the whole input image, the threshold
applied to each pixel within the unwarped marker image is based upon
the pixels around it.

This was the result of the work initiated by this thread on
srobo-devel:
https://groups.google.com/d/topic/srobo-devel/wa4ERK_9no0/discussion

We didn't originally adaptively threshold unwarped markers because it
appeared to reduce performance.  This turned out to be due to a bug
that was fixed in 7cd671161b94.

On Chris's set of test images, marker identification is improved from
this:

    Results
    ========
    True positives  728
    True negatives  995
    False positives 0
    False negatives 267

    Precision 100.0%
    Recall    73.1658291457%
    Accuracy  86.5829145729%

to this:

    Results
    ========
    True positives  826
    True negatives  995
    False positives 0
    False negatives 169

    Precision 100.0%
    Recall    83.0150753769%
    Accuracy  91.5075376884%
Merge branch 'master' into adaptive_marker
Merge branch 'master' into adaptive_marker
Merge branch 'master' into adaptive_marker
Add the beginnings of a libkoki context type

There are certain things that we want to do that would significantly
benefit from a common context instance being passed through the image
processing chain.  The thing that's mainly motivating me to do this is
the implementation of some logging stuff that'll be able to log both
text and images.  This will hopefully make it easier to debug things
when libkoki doesn't find a marker that one wants etc.

This patch adds a couple of functions that create a (currently
completely empty) instance of a "koki_t".  The user will call this,
optionally configure it, then pass it through to other functions that
need it -- e.g. koki_find_markers.
Add "logger" callbacks to the libkoki context

These callbacks will be called by the various things that want to log
stuff.

By default, the logger is configured to be the "null logger", which
just ignores everything that's thrown at it.
Add a text logger

This logger will only output text, nothing else.  It'll output to a
given stream or filename, and if provided with an image it'll state
that it was provided with one, but won't do anything with the image
itself.
Move variable declarations in marker_info to top

They were scattered around.
Send marker_info's error message to stderr
Merge branch 'master' into context

Bring the marker_info cleanup into the context branch
Make koki_find_markers{,_fp} take context pointers

This will allow them to do logging of stuff.

Also update the examples to be consistent with this change.
Add koki_log(): output a log message

This is simply a wrapper around the logging indirection stuff.  Code
within libkoki that isn't part of the logging internals should call
this function.
Add log message to the beginning of find_markers()

Indicate the find_markers() has started, and output the input image.
Add the basics of an HTML logger

This logs both text and images.  An HTML file knits them together.
Images are saved as PNG files that are referenced from the HTML file.
Add koki_is_logging()

Returns TRUE if the given libkoki context is configured with a logger
that is not the NULL logger.
Log the thresholded image

The thresholded image can be very useful for debugging purposes.
However, the pixel-by-pixel approach that we use does not actually
construct the thresholded image.  This patch constructs a temporary
thresholded image if we are logging, and logs it once it is
completed.
html logger: Output a BR tag after each image

The HTML formatting really needs to be improved, but for now, just
output a BR tag after each image.
Add a new example utility that logs to HTML

This is quite useful...
Log unwarped and cropped unwarped marker images

These images are exceptionally useful for debugging.
Remove the old method of seeing of unwarped images

Now that the logging infrastructure exists, it is no longer necessary
to use the preprocessor to enable/disable the display of unwarped
marker images.