Tesseract, opencv and SWT (stroke width transform)

1,296 views
Skip to first unread message

Bojidar Stanchev

unread,
Jun 8, 2016, 4:56:43 AM6/8/16
to tesseract-ocr
I'm developing an Android app, recognizing text from video taken with the phone's camera.
I'm using opencv 3.1 for image processing and preparation.
Then I cut out the words from the image, clean them up as much as possible - again with opencv.
Finally I pass small images to tesseract with one, sometimes 2 words when the word detection makes a mistake.
So far I recognize very well all words in a normal font and even on text as small as font 6.

The problem:
Currently I recognize black text on white background us.
I detect the text using a simple method - to put it simple - I "smudge" the words and find the contours then the bounding rects of those contours and so on.
I want to be able to detect text in various scenarios, even when the
background is very colorful and the text is any color. As far as I know the best way to do this is use SWT.
The question: is there any open source implementation of SWT using opencv?

tl;dr; I want to recognize text in various scenes using SWT, how to do it with opencv and tesseract available?

Allistair

unread,
Jun 8, 2016, 5:09:00 AM6/8/16
to tesser...@googlegroups.com
Google is going to be your best friend re. whether OpenCV has a SWT module, it didn't when I was looking back in 2014. I remember I also read a fair bit on SWT back when I was doing an Android OCR project. I eventually found a couple of projects (can't quite remember their names) in the open source domain implementing SWT. I am sure one of them was a script for Matlab so you could search SWT+Matlab. In both cases rather than trying to implement SWT myself right into the app thinking it would work I took the approach of finding a current SWT implementation to see what efficacy I got with my inputs (then plugged into Tesseract) and the results were pretty poor on the SWT side of things. I know SWT does very well for things like consistent font signage in natural world scenes, but like you my inputs were extremely varied font styles. So even if SWT is an approach for you it won't be a silver bullet, I concluded it would take a lot of time training and adjusting levers. I was also using OSS implementations so probably not state of the art. Good luck - update us if you find a working SWT->Tesseract pipeline.

--
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 https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/dfed43fd-9b49-48ff-affe-abc1745b68a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages