49 Commits

Author SHA1 Message Date
Erik Auerswald e914669079 add option -F, --adapt-after-crop
When this option is used, the threshold is adapted to the cropped
image, i.e., after the "crop" command, but not directly before.
This allows to avoid adjusting the threshold to the full image,
and thus potentially reduce the time needed for recognition.
2025-03-23 19:03:48 +01:00
Erik Auerswald b44a4ad72a update copyright years 2025-02-01 19:33:29 +01:00
Erik Auerswald 40c34ad6d7 tweak --help and --version output 2024-05-19 01:05:22 +02:00
Erik Auerswald 6569ca9f6b update copyright years 2024-02-23 19:03:58 +01:00
Erik Auerswald 48da4ee8c1 help: align equal signs in Defaults section 2024-02-23 18:58:58 +01:00
Erik Auerswald 1a8c4d7701 help: mention that rotate is clockwise 2024-02-23 18:57:04 +01:00
Erik Auerswald 898f5ec712 allow to specify a range for the number of digits
This can be helpful when using ssocr with a display showing
a variable number of digits, e.g., a clock, a scale, or a
thermometer.
2023-05-01 16:19:12 +02:00
Erik Auerswald 9e2d37ddbf add option -M, --min-char-dims=WxH
When there is a bit of noise in the image, the segmentation
step might find lots of small potential digits that are not
really digits (or other characters) of the display.  Given
sufficiently large display characters, it may be possible
to specify minimum character dimensions to remove spurious
potential characters (digits) based on their size.
2023-04-30 19:14:19 +02:00
Erik Auerswald 06c2afc85e add option -N, --min-segment=SIZE
This option is similar to -n, --number-pixels=#, but also
applies the limit to ratio based detection (i.e., for
recognition of "one" and "minus").
2023-04-29 11:53:32 +02:00
Erik Auerswald ea8f724846 update copyright years 2023-04-23 12:53:48 +02:00
Erik Auerswald 9386643c60 improve help output
The height/width threshold used for recognizing a 1 did
mention this use.
2023-04-23 12:48:37 +02:00
Erik Auerswald b83610d7d2 update copyright year 2022-01-25 18:38:52 +01:00
Erik Auerswald f2d86220ba remove trailing space from charset help output 2021-11-01 15:16:19 +01:00
Erik Auerswald 2ebe192fb2 add charset "tt_robot"
In 2017, I received a report of ssocr being used to interpret the
status display of some Chinese table tennis robot.  The user had
implemented character recognition in a Perl script that interpreted
the ASCII art segments in ssocr's debug output.

The new ssocr character set "tt_robot" implements the exact same
segment interpretations as found in the Perl script mentioned above.
This even includes two erroneous '7' definitions that work around
recognition problems.
2021-11-01 15:16:06 +01:00
Erik Auerswald 9b4690e68c help.c: remove unused include of string.h 2021-10-26 20:27:59 +02:00
Erik Auerswald ab6dab59ad two small corrections in help output 2021-04-27 19:18:02 +02:00
Erik Auerswald 113d665135 add ability to detect and print white space
This adds an option to enable white spece detection, and two
further options to control the operation of white space detection.

White space detection (--print-spaces) is intended for use cases
where digit (resp. character) grouping is important for correct
interpretation.  One use case is the recognition of superimposed
dates in photographic images.

This commit also increases the version number to 2.21.0 and tweaks
some debug output.
2021-04-25 14:05:51 +02:00
Erik Auerswald 161778751c show default values for decimal separator ratios 2021-04-19 19:37:39 +02:00
Erik Auerswald dc463a5529 options to control decimal separator recognition
Additionally, bump copyright dates and version number.
2021-04-19 19:27:52 +02:00
Erik Auerswald 17928b4b76 always use spaces for indentation, not tabs 2019-03-10 18:06:58 +01:00
Erik Auerswald 9569289c63 bump copyright year to 2019 2019-02-02 13:08:13 +01:00
Erik Auerswald d25ddb4674 final step of character set support
This implements selection of character set to recognize and documents
it in the man page.
2018-08-05 07:01:50 +02:00
Erik Auerswald 116e3e0dad remove not needed include of stdlib.h from help.c 2018-08-05 05:28:56 +02:00
Erik Auerswald d6a957e6d3 move character printing to a separate function
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.
2018-08-05 05:24:38 +02:00
Erik Auerswald a5d77497ee use a shorter usage description after errors 2018-07-27 22:04:56 +02:00
Erik Auerswald 6e8a7855df rename --ignore-decimal to --omit-decimal-point
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.
2018-07-25 15:50:50 +02:00
Erik Auerswald 583b96263c bump copyright year to 2018 2018-07-24 15:18:05 +02:00
Erik Auerswald bfc6e60b81 add option -G, --ignore-decimal
This option omits decimal points from the output. This can be used
to ignore isolated pixel clusters (together with --number-digits=-1).
2018-07-24 15:12:49 +02:00
Erik Auerswald 3afa041b95 improve --adjust-gray & gray_stretch documentation 2018-07-24 14:24:54 +02:00
Erik Auerswald f87b4a80bd enable executing dilation & erosion N times...
...with optional parameter N instead of repeating the command
2017-11-19 15:33:29 +01:00
Erik Auerswald 4df402f3d9 added option -X, --print-as-hex to change output
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.
2017-10-22 18:44:59 +02:00
Erik Auerswald 719ca823a1 add option -S, --ascii-art-segments
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.
2017-10-22 17:19:16 +02:00
Erik Auerswald 1f1094ab0d Fix help output of default back-/foreground colors
The help section supposed to show default values would
display the current back-/foreground colors instead of
the defaults.
2017-02-26 21:51:04 +01:00
Erik Auerswald 482969cd12 bump copyright year to 2017 2017-02-26 21:38:51 +01:00
Erik Auerswald c7d6b4bda5 Fix description of -b, --background option
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.
2017-02-26 21:28:28 +01:00
Erik Auerswald 2fc3a07190 bump copyright year to 2016 to reflect recent changes 2016-08-08 21:11:22 +02:00
Erik Auerswald 55a982e253 use a float for one_ratio comparison, and bump copyright year 2015-02-23 15:52:56 +00:00
Erik Auerswald b931ce6209 bumped overlooked copyright year 2014-10-27 17:07:14 +00:00
Erik Auerswald 842cae99e2 bumped version number and copyright year 2014-10-27 09:45:23 +00:00
Erik Auerswald 9865a9ea41 Added new command 'mirror' and bumped version to 2.16.0.
This command enables recognition of Critiano Fontana's images.
2013-12-29 05:29:51 +00:00
Erik Auerswald 6175a6fd6b Added patch from Cristiano Fontana <fontanacl@ornl.gov> to recognize
a minus ('-') sign.

The patch fixes a comment typo as well.

After applying this patch, ssocr will crash if it finds a "digit" with
zero height. This will be fixed in the next commit.
2013-12-22 14:35:17 +00:00
Erik Auerswald 16bcc37f78 Bumped copyright years to 2004-2013. 2013-01-08 16:56:37 +00:00
Erik Auerswald 73d7d697c2 Added auto-detection of number of digits in seven segment display.
Instead of specifying the excat number of digits in the display, use
--digits -1 to have ssocr auto-detect the number of digits. When this
is used, ssocr cannot check if the correct number of digits has been
recognized.

Bumped version number to 2.13.0 to indicate a new feature.
2012-11-04 17:24:21 +00:00
Erik Auerswald dc70232167 Use extern global variables for ssocr_foreground / ssocr_background. 2012-07-13 16:14:57 +00:00
Erik Auerswald a45d5cd5d8 Bump copyright to 2004-2010,2012. 2012-02-16 08:58:31 +00:00
Erik Auerswald 5bd1f54b5d Updated copyright statement. 2010-06-08 11:59:09 +00:00
Erik Auerswald b2c754d318 Document how to read image from stdin. 2009-08-07 10:37:46 +00:00
Erik Auerswald 5738646605 Use "gray" and "color" consistently (A.E.). 2009-08-05 05:14:45 +00:00
Erik Auerswald a1a060b416 - refactor image processing and online help in seperate files
- no functional changes
- this is another step towards refactoring the recognition algorithm
- this is another step towards factoring out the image access routines to
  ultimately replace Imlib2 by something else (e.g. gd)
2009-01-06 11:22:10 +00:00