auerswal / ssocr

Seven Segment Optical Character Recognition
https://www.unix-ag.uni-kl.de/~auerswal/ssocr/index.html
GNU General Public License v3.0
202 stars 38 forks source link

Fails to recognise the point #10

Closed fourdollars closed 4 years ago

fourdollars commented 4 years ago

https://i.imgur.com/N0lwjIA.png is 14.09 however it fails to recognise the point.

$ ssocr -V Seven Segment Optical Character Recognition Version 2.19.0 Copyright (C) 2004-2018 by Erik Auerswald auerswal@unix-ag.uni-kl.de This program comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under the terms of the GNU GPL (version 3 or later)

$ ssocr -P -d -1 N0lwjIA.png

================================================================================ flags & VERBOSE=0 thresh=50.000000 flags & PRINT_INFO=0 flags & ADJUST_GRAY=0 flags & ABSOLUTE_THRESHOLD=0 flags & DO_ITERATIVE_THRESHOLD=0 need_pixels = 1 ignore_pixels = 0 number_of_digits = -1 foreground = 0 (black) background = 255 (white) luminance = Rec709 charset = full height/width threshold for one = 3 width/height threshold for minus = 2 optind=4 argc=5

================================================================================ argv[argc-1]=N0lwjIA.png used as image file name image width: 212 image height: 106 0.00 <= lum <= 255.00 (lum should be in [0,255]) adjusting threshold to image: 50.000000 -> 50.000000 using threshold 50.00 auto detecting number of digits: 4 digits are at most 55 pixels wide and 95 pixels high found 4 digits digit 0: (1,9) -> (21,91), width: 20 ( 9.62%) height: 82 (78.10%) height/width (int): 4, max_dig_w/width (int): 2, max_dig_h/height (int): 1 digit 1: (34,7) -> (84,101), width: 50 (24.04%) height: 94 (89.52%) height/width (int): 1, max_dig_w/width (int): 1, max_dig_h/height (int): 1 digit 2: (91,2) -> (146,95), width: 55 (26.44%) height: 93 (88.57%) height/width (int): 1, max_dig_w/width (int): 1, max_dig_h/height (int): 1 digit 3: (160,1) -> (209,96), width: 49 (23.56%) height: 95 (90.48%) height/width (int): 1, max_dig_w/width (int): 1, max_digh/height (int): 1 looking for digit 1 digit 0 is a 1 (height/width = 82/20 = (int) 4) looking for decimal points looking for minus signs Display as seen by ssocr: | || | | || | | || _|

1409

auerswal commented 4 years ago

Hi,

a quick look at the picture indicates that you would need to use the shear command (https://www.unix-ag.uni-kl.de/~auerswal/ssocr/ssocr-manpage.html#sect45) to allow ssocr to separate the decimal point (dot) from the preceding digit 4.

Thanks, Erik

auerswal commented 4 years ago

(I have save the image from the URL https://i.imgur.com/N0lwjIA.png locally as 14.09.png.)

The number in the image is correctly recognized after adding shear 13 to the command line:

$ ssocr -d-1 shear 13 14.09.png
14.09

You can use the -D resp. --debug-image option (https://www.unix-ag.uni-kl.de/~auerswal/ssocr/ssocr-manpage.html#sect18) to have ssocr create an image showing the picture after transformation steps and adding lines to show algorithm operation (see https://www.unix-ag.uni-kl.de/~auerswal/ssocr/ for a description). Without shear this debug looks as follows:

no_shear

As you can see, the decimal point / dot / period is included in the digit 4.

When adding shear 13 to the command line, the decimal point is separated from the digit:

shear_13

Thanks, Erik

fourdollars commented 4 years ago

Thx a lot. <3