Skip to main content

TextTron is a simple light-weight image processing based text detector in document images.

Project description

TextTron-Lightweight-text-detector

1. Introduction

TextTron is a simple light-weight image processing based text detector in document images. TextTron detect text with the help of Contours applied on a preprossed image. This meant for fast text detection without using any machine learning or deep learning model. Though this will not work well in scene text detection, only meant for document images

2. Quick Start

1. Requirements: numpy & opencv-python

  • pip install numpy
  • pip install opencv-python

2. Install the package

$pip install TextTron

Code is developed under following library dependencies
OpenCV = 4.1.2
NumPy = 1.17

3. Usage

3.1 API

i. Import the neccessary libraries and read the image

import cv2
from TextTron.TextTron import TextTron
img = cv2.imread(PATH)

ii. Pass the numpy or cv2 image to the TextTron

TT = TextTron(img) 
TT = TextTron(img, low=196,high=255,yThreshold=15,xThreshold=2) # Change this till you get good result

iii. Get the text bounding boxes

tbbox = TT.textBBox

iv. Get the ploted image (optional)

plotImg = TT.plotImg

v. If you want to set/decide best parameter for your case (optional)

TextTron.setParameters(img)

4. Contact

Ayan Gadpal : ayangadpal2 [at] gmail [dot] com

5. References

  1. Y. Liu, S. Goto, T. Ikenaga, "A Contour-Based Robust Algorithm for Text Detection in Color Images", IEICE TRANS. INF. & SYST., VOL.E89–D, NO.3 MARCH 2006
  2. Giotis, A., Gerogiannis, D., Nikou, C.: Word Spotting in Handwritten Text Using Contour-Based Models. In: Frontiers in Handwriting Recog. (ICFHR), 2014 14th Int. Conf. on. pp. 399{404 (Sept 2014), doi:10.1109/ICFHR.2014.73

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TextTron-0.45.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

TextTron-0.45-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page