How to detect Text Area from image?

chostDevil picture chostDevil · Apr 18, 2012 · Viewed 17.6k times · Source

i want to detect text area from image as a preprocessing step for tesseract OCR engine, the engine works well when the input is text only but when the input image contains Nontext content it falls, so i want to detect only text content in image,any idea of how to do that will be helpful,thanks.

Answer

karlphillip picture karlphillip · Apr 19, 2012

Take a look at this bounding box technique demonstrated with OpenCV code:

Input:

enter image description here

Eroded:

enter image description here

Result:

enter image description here