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

Wrong detection of 13 (detected as 8) #25

Closed maxux closed 6 months ago

maxux commented 6 months ago

Hey, I try to use ssocr to get real time monitoring of a battery which only have status display. I could get expected data but I hit an tricky case for a 0013 detected as 008. Is there any specific option to workaround this ?

Here is the full image: 2024-05-07-201625

Here is the debug cropped zone: testbild

The command executed:

./ssocr -f white -b black -d 4 -D crop 571 229 178 76 /tmp/2024-05-07-201625.png

Any tips are welcome, thanks ! :)

auerswal commented 6 months ago

You just need to crop away all image parts that do not show a single line of seven segment displays. The following works for this number from your image:

$ ssocr -f white -d 4 crop 571 235 140 55 issue25.png 
0013

For an image like this with many numbers, each shown with an individual group of seven segment displays, you need one ssocr invocation per number (i.e., per group of related seven segment displays).

maxux commented 6 months ago

Thanks, this works quite well on a large set of data ! With < 1% error, perfect, thanks a lot !