Sorry for the shilling, but here’s my upcoming project:
Please register your email address if you’re interested in it.
This is implementation of Chen, Huizhong, et al. “Robust Text Detection in Natural Images with Edge-Enhanced Maximally Stable Extremal Regions.” . Partly based on the sample available on Matlab .
Partly motivated by the fact that the example given from the Matlab site  contains helperGrowEdges and helperStrokeWidth functions which sources are sadly only available for owners of the newest Matlab. Thus I decided to implement those functions based on the literature and some of my own assumptions (e.g. pruning only the 8 neighbours, etc).
After reading thru the original literature , here’s how the algorithm works in a nutshell:
- Create Maximally Stable Extremal Regions (MSER) as basic region candidate for the text. The reason is that MSER is fairly robust to view point, lighting, and scale changes. It is also based on the assumption that texts in real life are normally distinct enough from the background.
- However, since MSER is sensitive to blurring (thus some regions might spill over to neighbouring ones), an Edge-Enhanced MSER is introduced to counter against that issue. It’s basically MSER region with pruning around the edge pixels along the gradient direction.
- Additional geometric filtering is applied, in my case a connected component labelling is used, in order to remove blobs that don’t match the given criteria (e.g. min area, eccentricity, etc)
- Create a distance transformed matrix from the Edge-Enhanced MSER
- And compute stroke width image from the distance transformed matrix. This is achieved by propagating the maximum value around the ridges of the matrix, to neighbours which have lower values recursively.
- Lastly, the resulting connected components are filtered based on the ratio of component’s standard deviation and mean values.
Here’s the sample original image:
And here’s the sample result, with the stroke width image on the right hand side, and the Tesseract-deciphered texts placed next to the detected candidate text region.
My code is available here: https://github.com/subokita/Robust-Text-Detection/tree/master. It requires C++11, OpenCV, and Tesseract libraries.
 Chen, Huizhong, et al. “Robust Text Detection in Natural Images with Edge-Enhanced Maximally Stable Extremal Regions.” Image Processing (ICIP), 2011 18th IEEE International Conference on. IEEE, 2011.