text-detection

Text detection with mainly MSER and SWT

Github星跟蹤圖

text-detection

This project aims to detect text regions in images using only image processing techniques with MSER (Maximally Stable Extremal Regions) and SWT (Stroke Width Transform). And also Tesseract-OCR
tool is used optionally, as assistance to the algorithm.

Please cite original paper:

Özgen, A.C., Fasounaki, M. and Ekenel, H.K., 2018, May. Text detection in natural and computer-generated images. In 2018 26th Signal Processing and Communications Applications Conference (SIU) (pp. 1-4). IEEE.

INSTALLING

Insall requirements.txt file

pip install -r requirements.txt

Or you can create conda environment with

conda env create -f requirements.yml

For OCR assistance, install Tesseract from package manager

sudo apt install tesseract-ocr

USAGE

Basic usage is

python text_detect.py -i <input-image>

You can give output path

python text_detect.py -i images/scenetext01.jpg -o <output-image>

More options available

python text_detect.py -i images/scenetext01.jpg -o <output-file> -d <light,dark,both,both+> -t

Option -i is image path, -o is output path, -d is SWT direction (default is both+), -t option chooses if Tesseract will be used. Normally Tesseract runs poorly if whole image given as input.
But I use it for final decision of bounding boxes and it is not required all the time.

If you want to give whole image to Tesseract to see the impact of the algorithm, try this.

python text_detection.py -i images/scenetext01.jpg -f

For more detail (seeing intermediate steps), the usage given below is also available.

python text_detection_detail.py -i images/scenetext01.jpg -d both+ -t

Sample Results

sample1

sample2

sample3

sample4

REFERENCES

B. Epshtein, E. Ofek, and Y. Wexler. Detecting text in
natural scenes with stroke width transform. In 2010 IEEE
Computer Society Conference on Computer Vision and
Pattern Recognition, pages 2963–2970, June 2010.

Á. González, L. M. Bergasa, J. J. Yebes, and S. Bronte.
Text location in complex images. In Proceedings of the 21st
International Conference on Pattern Recognition
(ICPR2012), pages 617–620, Nov 2012.

Y. Li and H. Lu. Scene text detection via stroke width.
In Proceedings of the 21st International Conference on
Pattern Recognition (ICPR2012), pages 681–684, Nov
2012.

主要指標

概覽
名稱與所有者azmiozgen/text-detection
主編程語言Python
編程語言Python (語言數: 1)
平台
許可證GNU General Public License v3.0
所有者活动
創建於2018-01-23 17:20:00
推送於2024-11-12 20:26:00
最后一次提交2024-11-12 23:25:47
發布數0
用户参与
星數199
關注者數15
派生數59
提交數27
已啟用問題?
問題數9
打開的問題數0
拉請求數3
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?