Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

text layout recognition with python

I'm trying to sort through several thousand scanned files and sort them into folders based on type (ie: if one of the files is a scanned copy of formA, then it should go in the formA folder, if it's a scanned copy of formB, then it should go in the formB folder, etc...). I feel like the best way to match the files and types is based on their text outlines, but am totally new to image processing, so if there's a better solution, then I'm all ears.

I'm working in python. Any ideas of a best way to do this? PIL? OpenCV? imageMagick?

Thanks in advance...

like image 513
danwoods Avatar asked Jul 11 '11 20:07

danwoods


People also ask

How does Python recognize text?

OCR with Pytesseract and OpenCV. Pytesseract or Python-tesseract is an OCR tool for python that also serves as a wrapper for the Tesseract-OCR Engine. It can read and recognize text in images and is commonly used in python ocr image to text use cases.

What is LayoutParser?

LayoutParser is a Python library that provides a wide range of pre-trained deep learning models to detect the layout of a document image. The advantage of using LayoutParser is that it's really easy to implement. You literally only need a few lines of code to be able to detect the layout of your document image.


2 Answers

This library is probably of interest to you -
http://code.google.com/p/ocropus/
Its made by googlers and lets you do OCR and layout analysis from python.
I had some trouble installing it, but that was quite a while back, so things may have gotten fixed by now.

like image 132
Aditya Mukherji Avatar answered Nov 14 '22 13:11

Aditya Mukherji


I don't know in what format you've got the scanned documents, but pdfminer can do layout analysis for pdf. I guess it would fit the bill for your purpose, provided you get the documents in somewhat decent pdf format (if you've just got "pure images", it won't do you any good)

like image 25
Steven Avatar answered Nov 14 '22 14:11

Steven