This is the first step towards support of different character sets.
Different character sets are intended to be used to e.g. select
between '6' and 'b', but also to receive an error if e.g. a decimal
display is recognized as a hexadecimal digit.
The decimal point is not ignored, it is found during image segmentation
and recognized as a decimal point, but then it is omitted from the
output. Thus '--omit-decimal-point' is a more fitting name.
The changed output format can be used for further processing in an
external filter to e.g. recognize characters not known to ssocr, or use
some fuzzy matching rules to work around variations in image quality.
This options prints the recognized segments, i.e. the display as
seen by ssocr, to standard error. This can be used as a quick check
what went wrong if the recognition does not work. Additionally,
it can be used to get the raw segment data to use a separate
program to interpret set segments as digits or characters.
The description of the -b, --background option wronlgy stated that
this sets the foreground color to the given value, but sets the background
color to the given value.
Bug reported by Robert Sund.
The recognition algorithm always works on a bitmap of set and unset
(foreground and background) pixels. The debug image used to show the
input image after image processing, but if the processing did not include
a command that replaced pixels with fore- or background pixel values,
it would not show which pixels are foreground, and which are not. This
commit uses the make_mono() function to create the debug image, thereby
creating a representation of the bitmap used for recognition.
The dynamic_threshold command interacts in suprising ways with the
default threshold adjustment used by SSOCR. The --absolute-threshold
option usually helps. Mention this in the man page.
The ssocr code itself uses math.h and thus libm. This library has been
linked to via recursive linking or the requirements of Imlib2 before
this commit. According to a report from Arne Wichmann this does not work
in all environments. While I do not know the exact circumstances under
which this problem occurs, adding -lm to the linker step is correct,
because ssocr uses it. It is incorrect to rely on Imlib2 to pull this in.