Python function implementing a text binarization function based on activations of modeled OFF center-surround cells of the Human Visual System, which detect light decrements (text) on bright background (page). The approach is robust to strong illumination changes, like shadows or highlights, making it good for text images which have been captured outdoors, perhaps with a mobile phone.
The function should work directly "out of the box". Just pass an RGB or grayscale document image (of dark text over a bright background) and get its binary version.
├── code [Directory: Source code]
│ └── text_binarization.py [The main binarization function, along with example demonstrations]
└── data [Directory: dataset. Test images and example]
- skimage
- imageio
- matplotlib
If you use this code in your research please cite the following paper:
- Vonikakis, V., Andreadis, I., & Papamarkos, N. (2011). Robustdocument binarization with OFF center-surround cells. Pattern Analysis and Applications, 14(3), 219-234.
- Vonikakis, V., Andreadis, I., Papamarkos, N., & Gasteratos, A. (2007). Adaptive Document Binarization: AHuman Vision Approach. Int. Conference on Computer Vision Theory and Applications. (pp. 104-110). Barcelona, Spain.