341 Commits

Author SHA1 Message Date
Erik Auerswald e09b230ebe Check for existence of rotation value before printing info about using it. 2013-12-29 04:19:29 +00:00
Erik Auerswald 9bc2098079 Fixed GPLv3 file. 2013-12-27 01:45:09 +00:00
Erik Auerswald a8d0c97522 Added Cristiano Fontana <fontanacl@ornl.gov> to AUTHORS. 2013-12-27 01:41:50 +00:00
Erik Auerswald 77c1c3b2c9 Bumped version number to 2.15.0 2013-12-27 01:41:07 +00:00
Erik Auerswald 2618998b12 Improved debug output when looking for '1', '.', and '-'. 2013-12-22 15:29:45 +00:00
Erik Auerswald bc7b131cb8 Cosmetics: line length shall be <= 80, no TABs for indentation. 2013-12-22 15:13:33 +00:00
Erik Auerswald 85ea454382 Use variable name 'd' instead of 'i' when iterating over digits. 2013-12-22 15:07:24 +00:00
Erik Auerswald 6b998fc3b3 Followup to Cristiano's patch:
- fix crash with zero height "digits"
- add Cristiano to THANKS
- add new option to man page
2013-12-22 14:57:57 +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 c48efcdb1e Fixed a comment. 2013-12-22 00:34:05 +00:00
Erik Auerswald d7f57f9dea Fixed spelling in one comment. 2013-12-22 00:24:30 +00:00
Erik Auerswald 8d0cfb60e9 Added Russell Currie <rc454@cam.ac.uk> to THANKS file.
"Thanks, I'm happy for you to add me (Russell Currie <rc454@cam.ac.uk>)."
Russel reported the floating point exception (division by zero) error
with zero width digits, and even provided patches fixing this.
2013-09-02 19:41:26 +00:00
Erik Auerswald c398203845 Avoid division by zero during recognition of "one" and "decimal point".
Do not divide by digit width or height if it is zero, just skip this
digit during special case recognition of a "one" or a "decimal point".

Currently, the scan line detection will see the following if digit width
or height is zero:
 _
|
|

This results in printing an underscore ('_') character for a not
recognized digit.

Bump version number to 2.14.1 for this bug fix.
2013-09-02 13:47:00 +00:00
Erik Auerswald 04215888a4 Avoid division by zero in debug output.
Do not divide by digit width or height if it is zero, print "NaN" instead
of the ratio normally printed. This concerns debugging output only,
something equivalent is needed for the actual recognition algorithm
as well.
2013-09-02 13:30:46 +00:00
Erik Auerswald 939bb8fab6 Added Tim Fardell <tim.fardell@btinternet.com> to the THANKS file for
reporting an alternative way to display the digit 9.

He wrote: "yes, please feel free to add me to the THANKS file :-)"
2013-08-05 16:05:26 +00:00
Erik Auerswald 2fbd82e27e Add alternate version of 9 digit (lower horizontal segment not set).
Reported by Tim Fardell.

Bump version number to 2.14.0 for this new feature.
2013-08-04 12:22:44 +00:00
Erik Auerswald 81903f0837 Whitespace cleanup: expanded tabs to 8 spaces. 2013-07-19 21:43:56 +00:00
Erik Auerswald b64af1afe9 Improved debugging output to track down a floating point exception.
The exception happens because an image with height 0 is detected.
2013-07-19 21:42:50 +00:00
Erik Auerswald 971b37308c Fixed dynamic_threshold (broken since "the beginning")
and bumped version number to 2.13.4.

As a result my regression tests using the _broken_ dynamic_threshold fail:

testing images in first2...FAILED
testing images in neu...FAILED
testing images in pics-2005-11-12...FAILED
testing images in schlechte_bilder...FAILED
testing images in new_token_2008-11-07...FAILED
testing images in calc_dyn_thresh...FAILED

But at least I do understand now why dynamic_threshold did not work as I had
expected...I just did not see the error until today.
2013-05-19 19:58:27 +00:00
Erik Auerswald 170f50477e THANKS: added Alan Bates (his email address is already publicly available
on his University's web presence).
2013-01-11 12:02:14 +00:00
Erik Auerswald 558c06f654 INSTALL: added link to ssocr website 2013-01-11 11:20:22 +00:00
Erik Auerswald 961f15dd3f Tweaked heuristic to recognize a decimal point.
Improved related debugging output as well.
2013-01-11 11:03:56 +00:00
Erik Auerswald 5a4e0ef5e0 Added some more Mac OS X compatibility stuff:
- use optimization level -O3, which is supported by both gcc and clang
- removed a set of unnecessary parenthesis
- added info about 'brew' on Mac OS X to INSTALL file

bumped version number to 2.13.3
2013-01-11 10:26:57 +00:00
Erik Auerswald 350a8f6b57 Bumped version number to 2.13.2 2013-01-11 05:38:08 +00:00
Erik Auerswald d540340fbd Fixed verbose message when writing image file to disk:
previous, wrong message:  using debug format for png image
current, correct message: using png format for debug image
2013-01-11 05:37:29 +00:00
Erik Auerswald 03434efeae Check for errors when loading or saving an image with Imlib2.
This relies on the definition of enum _imlib_load_error in Imlib2.h
and might break on different versions of Imlib2, but should be better
than the total lack of error reporting before.

Developed with Imlib2 version 1.4.5 from Debian/Sid:

$ dpkg -l libimlib2-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libimlib2-dev  1.4.5-1      i386         Imlib2 development files
2013-01-11 05:30:21 +00:00
Erik Auerswald 3357afec00 Makefile: use imlib2-config --libs for LDLIBS.
This should improve compatibility for systems with Imlib2 installed
in non-standard places, e.g. Mac OS X.

On Debian GNU/Linux this results in some warnings when building a .deb:

dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libdl.so.2 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libz.so.1 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libX11.so.6 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libfreetype.so.6 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libXext.so.6 (it uses none of the library's symbols)

I'm ignoring this. Special local adaptations like this have no place in
a general build system. A dedicated Debian package might apply a local patch
to strip these dependencies. This could result in a non-working ssocr as
at least libdl is actually needed by Imlib2 to load images.
2013-01-11 04:23:07 +00:00
Erik Auerswald d51eb5494d Replaced 'date -I' by 'date +%Y-%m-%d' to improve portability.
FreeBSD and Mac OS X don't know 'date -I', but do know 'date +%F' with
'%F' equivalent to '%Y-%m-%d'. POSIX knows neither '-I' nor '%F', but
just '%Y-%m-%d', so use the latter.

Problem reported by Alan Bates <abates@johncabot.edu>.
2013-01-11 04:03:45 +00:00
Erik Auerswald 7d0914bc2e svn:ignore generated file debian/changelog 2013-01-10 09:18:04 +00:00
Erik Auerswald 66953f5330 Added ssocr-?.??.? and *.tmp to svn:ignore. 2013-01-10 09:15:32 +00:00
Erik Auerswald d710fe151c Bumped version number to 2.13.1 for .deb build fix. 2013-01-10 09:06:28 +00:00
Erik Auerswald 16bcc37f78 Bumped copyright years to 2004-2013. 2013-01-08 16:56:37 +00:00
Erik Auerswald 35b5389b63 Makefile: add dependency on Makefile for basic components.
This way changing somethin in the Makefile, e.g. LDFLAGS, results
in a rebuild without the need for a previous 'make clean'.
2013-01-08 16:52:43 +00:00
Erik Auerswald 62b881988d Makefile: debian/rules needs to be executable. 2013-01-08 16:28:51 +00:00
Erik Auerswald a0a6adb809 Makefile: do not set execute permission on files in tar archive. 2012-11-11 20:16:49 +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 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