Commit Graph

105 Commits

Author SHA1 Message Date
Erik Auerswald cb107ace5b Don't accept -d, --digits 0, as this would result in writing to
unallocated memory.
2012-11-04 16:36:43 +00:00
Erik Auerswald f95d723da7 Moved allocation of memory for seven segment digits after image
processing stage.
2012-11-04 16:31:58 +00:00
Erik Auerswald 7141e50e77 Removed useless double initialization of digits[] array. 2012-11-04 16:26:00 +00:00
Erik Auerswald e5b601ca2d Bumped version number to 2.12.0. 2012-11-03 23:44:28 +00:00
Erik Auerswald 7db35c103f Added two comments (see diff). 2012-11-03 23:24:01 +00:00
Erik Auerswald e0cad46f58 Added recognition of hex digits A, b, C, c, d, E, F. 2012-11-03 23:15:47 +00:00
Erik Auerswald a3b51a8705 Added Carlos A. Neves to THANKS file for suggesting recognition of a
decimal point between seven segment digits.
2012-11-03 23:00:19 +00:00
Erik Auerswald c9261c2fea Added recognition of decimal points.
A decimal point (or thousands separator) is recognized by its small size
relative to the digits of the display. It must be counted in the number
of digits to recognize despite being no real digit.

Bumped version number to 2.11.0 as this is a new feature.
2012-11-03 18:37:44 +00:00
Erik Auerswald cd8a75a3bd Use '_' instead of '.' as a first step towards recognizing the decimal
point (or decimal comma, depending on locale) of, e.g., a scale.
2012-11-03 17:54:28 +00:00
Erik Auerswald f43e3e2aaa Added _FORTIFY_SOURCE checks (affects just strcat() currently). 2012-07-15 18:11:35 +00:00
Erik Auerswald 1d8e788e93 Removed function rgb_threshold() from imgproc.[ch].
All calls to this function have been replaced by calls to make_mono()
with the appropriate luminance type (minimum, red, green, or blue).
This way --foreground / --background work with the commands
{r,g,b,rgb}_threshold as expected.

Problem was "shear" setting background pixels using the specified
--background color, but rgb_threshold() always using the default colors
(foreground black, background white), ognoring the options.

Added a formerly failing test case to the regression tests:
  Lauro-LEDs-digits-fore_back
2012-07-13 17:03:43 +00:00
Erik Auerswald fbd00e8c96 Removed left-over debugging output. 2012-07-13 16:15:53 +00:00
Erik Auerswald dc70232167 Use extern global variables for ssocr_foreground / ssocr_background. 2012-07-13 16:14:57 +00:00
Erik Auerswald 3cc50515b3 Added ASCII art output of recognized segments to debug info. 2012-07-12 19:38:40 +00:00
Erik Auerswald 460d1bb540 Made "alternate seven" define more concise. 2012-07-12 18:27:51 +00:00
Erik Auerswald f66d25f978 Bumped version number to 2.10.0.
The new feature in this version is the INSTALL file.
I'm releasing this version in a moment.
2012-07-10 17:48:56 +00:00
Erik Auerswald 4caf2faf18 Added INSTALL file, installed to documentation directory. 2012-07-10 17:43:50 +00:00
Erik Auerswald f9c962219c Bumped version number to 2.9.9 [and released it]. 2012-06-10 20:04:06 +00:00
Erik Auerswald 9041d7d41b Fixed off-by-one error in shear operation.
One pixel per line was left unchanged.
2012-06-10 17:07:17 +00:00
Erik Auerswald 5a06da1133 Build fix for Ubuntu 11.10 and newer.
Build on recent Ubuntu systems would fail, because the --as-needed linker
option (enabled by default on these systems) needs a special argument
order for ld to work correctly.

(see http://www.gentoo.org/proj/en/qa/asneeded.xml)

Use LDLIBS instead of LDFLAGS to list needed libraries. See GNU Make docs
and http://www.roland-illig.de/articles/article-1.html for rationale.

Bumped version number to 2.9.8, so I can tell the users having build
problems to upgrade to this version.
2012-05-15 17:47:42 +00:00
Erik Auerswald c81562116d Bump version number to 2.9.7 (already released). 2012-05-15 17:25:52 +00:00
Erik Auerswald 5c6fab5617 Removed unused variable d_width from ssocr.c (spotted by GCC).
This fixes the following compilation error:

cc -Wall -W -Wextra -pedantic -Werror -pedantic-errors  -O6   -c -o ssocr.o ssocr.c
ssocr.c: In function ‘main’:
ssocr.c:963:21: error: variable ‘d_width’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make: *** [ssocr.o] Error 1

The compiler is right, the value of d_width is never used, the variable is
not useful and can be removed.

My regression tests all pass. :-)
2012-02-17 20:55:42 +00:00
Erik Auerswald 4051038571 Added Jörg Mayer to the THANKS file. 2012-02-16 14:43:24 +00:00
Erik Auerswald a45d5cd5d8 Bump copyright to 2004-2010,2012. 2012-02-16 08:58:31 +00:00
Erik Auerswald 19d4ffc45f Fixed an unitialized variable error:
GCC on Ubuntu 11.04 64-bit produces the following error:

ssocr-2.9.5$ make
cc -Wall -W -Wextra -pedantic -Werror -pedantic-errors  -O6   -c -o
ssocr.o ssocr.c
cc1: warnings being treated as errors
ssocr.c: In function ‘main’:
ssocr.c:57:11: error: ‘count’ may be used uninitialized in this function
make: *** [ssocr.o] Error 1

This was reported by Bruce Dudek <bd4465@comcast.net>.

If no input could be read from STDIN a spuriour error message might have
been created by this error.

Bumped the version number to 2.9.6 to reflect the bugfix.

Waiting for Bruce to tell me if I may add his name and email address to the
released THANKS file (the checked in version does contain it both).
2012-02-15 15:51:49 +00:00
Erik Auerswald dcf38657ab Added archives and temporary directory to svn:ignore list. 2010-06-08 19:16:47 +00:00
Erik Auerswald 51933261bf Added ATUTHORS, COPYING and THANKS files to .tar.bz2 and .deb archives.
Bumped version number to 2.9.5.
2010-06-08 19:13:51 +00:00
Erik Auerswald 5bd1f54b5d Updated copyright statement. 2010-06-08 11:59:09 +00:00
Erik Auerswald 147e71b685 Bumped version number to 2.9.4. 2010-06-08 10:51:32 +00:00
Erik Auerswald f96121c7ba Added THANKS file to honour contributors. 2010-06-08 10:40:17 +00:00
Erik Auerswald 39ed406c47 Added alternate form of digit seven.
Reported and code provided by Francesco Iovine <asso@hilab.it>.
2010-06-08 10:35:35 +00:00
Erik Auerswald 628ffb803e Fixed typo (direcotory -> directory). 2010-03-18 11:16:43 +00:00
Erik Auerswald 12a5408733 Bump version number to 2.9.3 (and make bugfix release). 2009-09-07 15:26:20 +00:00
Erik Auerswald 4166a962e2 Ignore generated manual page ssocr.1. 2009-09-06 16:18:52 +00:00
Erik Auerswald 26366b45a7 Correct off-by-one error in vertical scanline. The first "third" was too long,
the third "third" too short.

This error was detected with a digit "four" of 15 pixels height with a three
pixels thick middle segment.

Since integers are used for computation this is still not very exact and may
still be off by one, at least in some corner cases.

The regression tests now contain the problematic image and pass completely.
2009-09-06 16:14:10 +00:00
Erik Auerswald ac06b833c3 Move recognition of digit "one" and debug output with digit coordinates
below vertical segmentation.

Before this the recognition of a "one" used the image height instead of
the digit height. This kind of worked because for all practical purposes
the image was cropped to leave just the digits.

The debug output of digit coordinates was flawed the same way.

Since now the real height/width ratio is used to recognize a "one" the
empirically determined default value had to be adjusted as well. Using this
value my regression tests are all passed.
2009-09-06 15:57:44 +00:00
Erik Auerswald 175e05a29b Correction of .PHONY entry in Makefile. 2009-08-17 11:57:48 +00:00
Erik Auerswald 11a7c54f6b Bump version number to 2.9.2 2009-08-15 14:10:37 +00:00
Erik Auerswald cba330b81f Correct a comment (copy&paste error). 2009-08-11 09:42:08 +00:00
Erik Auerswald 3be6d19137 Document use of - as output filename. 2009-08-11 08:33:35 +00:00
Erik Auerswald be3bb8f66b Add - as shorthand for /proc/self/fd/1 to image save function. 2009-08-11 08:19:08 +00:00
Erik Auerswald d01795f191 Improve verbose messages when writing image files. 2009-08-11 07:48:40 +00:00
Erik Auerswald 6aeb2d1cb4 Create debian/changelog dynamically from current version number. 2009-08-10 10:51:46 +00:00
Erik Auerswald d5f8415b39 Set umask before creating temporary file.
Up to glibc 2.06 mkstemp() created files with permission 0666. Later versions
use 0600. POSIX does not specify file permissions for mkstemp, therefore
umask() with mode=077 is called just before calling mkstemp().
2009-08-09 13:02:25 +00:00
Erik Auerswald 59a0049449 Document $TMP environment variable in manual page. 2009-08-09 06:20:38 +00:00
Erik Auerswald ff2f895dae Bump version number to 2.9.1 (including debian/changelog). 2009-08-09 06:10:56 +00:00
Erik Auerswald 1f86afa0d2 Add debug output to tmp_imgfile() function. 2009-08-09 06:06:26 +00:00
Erik Auerswald 484e1782a4 Create temporary file in $TMP, or /tmp if $TMP is empty/unset. 2009-08-09 05:57:47 +00:00
Erik Auerswald d14849a9af Improve error message for failed strdup() call. 2009-08-09 05:18:13 +00:00
Erik Auerswald df65ecb267 Change name of image file from temporary filename back to "-" after
deleting the temp file.
This is compile tested only.
2009-08-08 15:33:47 +00:00