7-Segment Display OCR
I’m building an iOS application (take a picture and run OCR on it) using Tesseract (an OCR library) and it is working very well with well written numbers and characters (using usual fonts).
The problem I am having is that if I try it on a 7-Segment Display, it gives very very bad results.
So my question is: Does anyone know how I can approach this problem? Is there a way for Tesseract to recognize these characters?
2 Solutions Collect From Internet About “7-Segment Display OCR”
I too had great difficulty in getting tesseract to recognize digits from images of LCD displays.
I had some marginal success by preprocessing the images with ImageMagick to overlay a copy of the image on itself with a slight vertical shift to fill in the gaps between segments:
$ composite -compose Multiply -geometry +0+3 foo.tif foo.tif foo2.png
In the end, though, my saving grace was the “Seven Segment Optical Character Recognition” binary: http://www.unix-ag.uni-kl.de/~auerswal/ssocr/
Many thanks to the author, Erik Auerswald, for this code!
I haven’t tried OCRing 7-Segment Display, but I suspect that the problem might be caused by the characters not being connected components. Tesseract does not handle disconnected fonts well from my experience.
Simple erosion (image preprocessing) might help by connecting segments, but you would have to test it and play with kernel size to prevent too much distortion.
- Checking Hashable conformance
- Cross-compiling ZeroMQ to ARM for use in a MonoTouch iPhone app configure settings
- Xcode -dynamic not specified static library error
- Temporarily Lock or Disable iphone home button
- How can I dismiss the keyboard if a user taps off the on-screen keyboard?
- NSDate get year/month/day
- Prevent iOS mobile safari from going idle / auto-locking / sleeping?
- Performance when frequently drawing CGPaths
- How to add UITableView in a UIAlertView in swift
- How to replicate hash_hmac('sha256', $key, $secret_key) function in Swift 4?
- XCode / iOS simulator: Trigger significant location change manually
- Using selector in Swift 3 NotificationCenter observer
- How can I Pause a NSOperation in a NSOperationQueue?
- iCloud KeyValue store not recognized on first launch
- Swift countDown timer Logic