311 Commits

Author SHA1 Message Date
Erik Auerswald 895b0cb2b5 bump version number to 2.24.0 v2.24.0 2024-06-22 20:05:30 +02:00
Erik Auerswald 894f3035fd fix a special case for decimal point recognition
When the widest digit found in the image is a one, it is likely
that a decimal separator is nearly as wide as this digit.  Thus
it cannot be recognized, because the decimal separator needs to
be at most half as wide as the widest digit (before this commit).

Thus add an additional pass over the digits for this special case.
This pass comes after the existing recognition passes for the
digit one, decimal separator, and minus sign.  In the new pass,
the width of the digit is ignored.

This addresses GitHub issue #26.
2024-06-22 20:04:08 +02:00
Erik Auerswald 40c34ad6d7 tweak --help and --version output 2024-05-19 01:05:22 +02:00
Erik Auerswald bae7381e34 add lower case r to character set "full" 2024-05-18 23:51:13 +02:00
Erik Auerswald d6be469e14 add lower case h to character set "full" 2024-05-18 23:49:07 +02:00
Erik Auerswald af6c53c3f3 add lower case n for consistency with lower case c
Neither lower case c nor lower case n can happen with correct
image segmentation.  Lower case c was already used in the code,
but lower case n was only found as a comment.

I am not sure if I want to keep this or rather remove both lower
case variants.  I do want to have this consistent, though.
2024-05-18 21:44:42 +02:00
Erik Auerswald b05410efae man page: fix "white_border" description
The command name stems from the time when ssocr always considered
"white" as background and "black" as foreground.  The intention
has always been to ensure some background border around the seven
segment displays, and the implementation always followed this.  The
output of --help correctly uses "background" for the "white_border"
description.  Now, the man page description is correct, too.
2024-05-09 16:19:36 +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 624e998efb NEWS: mention message improvements 2023-09-10 14:54:27 +02:00
Erik Auerswald 81c5472b69 add program name to warning messages 2023-09-10 14:49:12 +02:00
Erik Auerswald 6fc62729e9 improve error message for wrong number of digits
* Use different messages for single digit and digit ranges.
* Use singular when looking for one digit, plural otherwise.
2023-09-10 14:35:49 +02:00
Erik Auerswald 19f93dcb58 fix debug output regarding flag DEBUG_OUTPUT 2023-07-26 19:50:15 +02:00
Erik Auerswald 5ca3455873 add ssocr version to debug output 2023-07-26 19:47:01 +02:00
Erik Auerswald 2026f39ee7 INSTALL: tweak prerequisites list 2023-05-21 18:45:08 +02:00
Erik Auerswald 73e7a69b4c INSTALL: mention (GNU) make as prerequisite 2023-05-20 19:37:29 +02:00
Erik Auerswald f25047745d INSTALL: mention gcc and man under prerequisites 2023-05-20 16:58:38 +02:00
Erik Auerswald 658230679a bump version number to 2.23.1 v2.23.1 2023-05-18 16:13:18 +02:00
Erik Auerswald 1fe392c772 use latest release date as man page date
The latest release date is extracted from the NEWS file,
i.e., it depends only on the sources, not the build date.
This is intended to help in creating reproducible builds
by avoiding timestamps.  It is also closer to the date of
the contents of the man page than using just the latest
copyright year.

I do not have a perfect solution that works for both a git
clone and a downloaded tar ball.  This solution works well
for released tar balls of the ssocr sources.
2023-05-14 17:37:48 +02:00
Erik Auerswald 2ff3d882b9 Makefile: remove quotes from inside VERSION variable 2023-05-14 17:21:37 +02:00
Erik Auerswald f06f8441fd Makefile: use single quote when possible 2023-05-14 17:01:26 +02:00
Erik Auerswald a5c550b72b Makefile: man page also depends on help.c 2023-05-14 16:26:34 +02:00
Erik Auerswald 0c3adc9002 avoid useless digit memory copy
There is no need to copy digit memory if all potential
digits are kept.
2023-05-13 20:05:23 +02:00
Erik Auerswald ad9027b6a0 guard against some integer overflows
When determining memory allocation sizes, integer overflow can
lead to memory safety errors.  Add some guards to prevent this.
2023-05-13 19:58:16 +02:00
Erik Auerswald 66dbee3591 typo fix in NEWS 2023-05-12 18:28:16 +02:00
Erik Auerswald c6e09b8f70 INSTALL, README: add commas around "e.g." 2023-05-12 18:27:19 +02:00
Erik Auerswald 7e056835fa man page: mention -- to end option-scanning 2023-05-11 21:25:31 +02:00
Erik Auerswald 050830a709 man page: use latest copyright year, not build date
In order to help creating reproducible builds of ssocr,
do not use the build day of the man page as the date
inside the man page.  Instead, use the latest copyright
year of ssocr.

Using the man page build date has always been problematic,
because it is misleading.  But I do not have a general
automatic way to maintain the last change date for the
man page that works for both git clones and tar balls.
This seems like an improvement to me.  It provides some
idea of how old the man page is, and this date depends
only on the ssocr source code, not the build date.

This should help with one of the two problems reported
in GitHub issue #22.
2023-05-09 18:11:53 +02:00
Erik Auerswald 27e7913135 append '+' to version to indicate changes 2023-05-09 18:10:25 +02:00
Erik Auerswald 0cd776b479 bump version number to 2.23.0
This ssocr release adds new features and thus addresses
GitHub issue #21:

* new option -N, --min-segment=SIZE
* new option -M, --min-char-dims=WxH
* a range of expected digits can be specified (before, only
  a single number could be specified, or the number could be
  left unspecified)
v2.23.0
2023-05-01 19:36:47 +02:00
Erik Auerswald cf2391f400 do not accept 0 expected digits
This did not work before, and it was not intended to change
this.

I do not know of a use case where one is expecting no digits
at all, but is using ssocr to recognize the non-existing
digits.  If you do have such a use case, let me know.
2023-05-01 17:00:49 +02: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 8df40937c9 accept any number of digits during segmentation
If a specific number of digits is expected, i.e., without
-d-1, the number of found (potential) digits is compared
with the expected number, and ssocr errors out on mismatch.

This prepares for the introduction of an option to reject
some potential images, e.g., because they are too small to
contain a digit or character from the display.

It also prepares for allowing a range of digits as the
expected segmentation result, e.g., for a clock display
with a blinking colon (:), or for a thermometer display.
2023-04-30 16:29:47 +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 2d6b019842 consistently use "scanline" in comments 2023-04-24 17:04:34 +02:00
Erik Auerswald 8660a65ebd append '+' to version string during development 2023-04-24 17:03:33 +02:00
Erik Auerswald fe272d21ef bump version number to 2.22.2
This "bug fix" release comprises documentation improvements only.
v2.22.2
2023-04-23 14:45:57 +02:00
Erik Auerswald 61721919cc man page: --ignore-pixels pertains to rows, too 2023-04-23 14:39:24 +02:00
Erik Auerswald d5b6c0852d man page: improve descriptions of -r, -m, -H, -W 2023-04-23 13:44:56 +02:00
Erik Auerswald ea8f724846 update copyright years 2023-04-23 12:53:48 +02:00
Erik Auerswald 320487e300 tweak alignment of some debug output 2023-04-23 12:50:02 +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 f7098c6ff5 man page: add some information
* a general description of options and commands
* so far only the "crop" command changes image dimensions
2022-12-10 13:38:31 +01:00
Erik Auerswald 3ebd31d09d man page: tweak -s, --print-spaces description 2022-12-10 13:19:47 +01:00
Erik Auerswald 629ecd05f6 bump version number to 2.22.1 v2.22.1 2022-01-25 18:56:14 +01:00
Erik Auerswald 145c9f74cb Makefile: man page depends on defines.h for version number 2022-01-25 18:55:31 +01:00
Erik Auerswald b83610d7d2 update copyright year 2022-01-25 18:38:52 +01:00
Erik Auerswald 9709e55683 Makefile: use pkg-config without imlib2-config
Since I have used imlib2-config since "the beginning," I prefer
to keep it as long as it is available.  But for systems with a
newer Imlib2 version, a fallback to pkg-config is required.
2022-01-24 21:01:37 +01:00