OCR with difficult circumstances, is it even possible?

154 views
Skip to first unread message

Marc Bruins

unread,
Jul 21, 2015, 3:28:40 AM7/21/15
to tesser...@googlegroups.com
Hello all,

I was wondering if it was possible to scan the cubical meters and the liters on a water meter.

There are a lot of circumstances possible where it is harder to scan the image which are
  • The reflection of the camera on the glass
  • Numbers can be half way down or up
  • Most of the time these meters are found in very dark places
  • It happens a lot that there is moist under the glass
  • There are different fonts and sizes
The meter which im talking about is this:



So my question, is it even possible? If so what would you guys recommend to create a good OCR for this (Which steps do i need to take?).

Kind regards,

Wickpick

Allistair

unread,
Jul 21, 2015, 5:03:37 AM7/21/15
to tesser...@googlegroups.com
You will have much better success here by developing a routine that crops out the area of the meter containing the numbers before running it into OCR. If for instance all your meters look the same, you can guide the creation of the photo with for instance an app with an overlay of where to position the meter in the camera view (see card.io for an example). Then you can focus on OCR for the digits and there are many other posts on this forum about improving OCR for these kinds of display I think.

The red one is hard because it looks like it can be partially in-view and so you won't get a good read off of any non-fully-rotated numbers. Solving that part is beyond what I know but I would be surprised if OCR will do it. Maybe better to look at template matching perhaps. I guess if you follow what I said about getting an image of just the number strip then you can partition that into each number. You can then crop the borders away leaving 6 images and then you can measure the amount of white at top and bottom. If you find there is a certain amount beyond a threshold it tells you the number is rotated and maybe you tell the user (if an app) that they need to wait for numbers to fully rotate.

Manual fallback is always worth considering. E.g. card.io and Apple Pay scan the card BUT always offer the user the ability to modify just in case. Don't really 100% on OCR.

Dirt/grease/moisture that affects the number area will also be hard to tackle in all cases. Some cases will probably be solvable with some image processing techniques but you can never say for sure what you're going to get in the field hence manual input always worth having.

Cheers

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/8c39934a-2c3c-4d3e-8355-466bf11eeec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dmitri Silaev

unread,
Jul 21, 2015, 12:59:53 PM7/21/15
to tesser...@googlegroups.com
Hi Wickpick,

What's your final goal? To collect still images from designated people occasionally visiting the meter installation site? Or placing e.g. an unattended camera to establish permanent meter monitoring? Depending on this approaches may vary.

For partially rotated numbers template matching is definitely a way to go. You may try to train Tesseract for partial digits - as an easier alternative - but I'm not sure it would perform well.

Not quite clear - do you need to read the liter dials? If so then it isn't an OCR problem but rather a general computer vision problem. You would need to devise your own image processing pipeline along with the algorithmic approaches. I'm not sure it's worth implementing... Anyway, look what I've found as the first search result: https://etd.ohiolink.edu/rws_etd/document/get/case1258511722/inline A neat combo of simple math and algo techniques but accuracy in practice?

Reflections are a thing that you certainly need to get rid of. Most of the time they render images unreadable even by humans.

As for moist, it can present a problem as long as it's condensed vapor covering the entire or part of the glass. If it's mostly just liquid at the bottom then it's usually alright.

And finally, I suppose Tesseract already has a pretty decent collection of trained fonts to work with most meter types.

Regards,
Dmitri Silaev
www.CustomOCR.com




--

Marc Bruins

unread,
Jul 27, 2015, 4:53:00 AM7/27/15
to tesseract-ocr, alli...@gmail.com
Hi Allistair,

Thanks for your reaction. My idea is an app which people can use on there Android smartphone thats scans the meter reading. The red characters don't have to be scanned. I was planning to use an overlay for getting a better image for the OCR. Besides that i will implement an fallback.


Op dinsdag 21 juli 2015 11:03:37 UTC+2 schreef Allistair C:

Marc Bruins

unread,
Jul 27, 2015, 5:01:58 AM7/27/15
to tesseract-ocr, daemo...@gmail.com
Hi Dmitri,

The goal is create an app on which the user can scan his watermeter reading without the liters.  I'll guess i need to find a way to make the users take a clear picture of the meter.

I'm a bit confused about the template matching and the tesseract story. What i understand is as follows, the best way to get the partial numbers is to use template matching and when those images are produced use tesseract to get the values from the images to text? Or did i misunderstood?

Thanks in advance :)



Op dinsdag 21 juli 2015 18:59:53 UTC+2 schreef Dmitri Silaev:
Reply all
Reply to author
Forward
0 new messages