OCR with QT
-
Whether there any module in QT which I can use for Optical character recognition in order to extract text from image of document ?
In following disccusion I have noticed that I need to use "Tesseract with Qt and OpenCV".
https://forum.qt.io/topic/14502/ocr-in-c/11
I have used it and it gives good result with documents with clear text with black color fonts on white background.
But when I use it with image of following types of documents then I do not get satisfactory results and get many errors in output text
- Document with white texts on black background
- Handwritten documents
- Document with two columns of texts for example in newspapers
- Colored certificates
- Document with mathematical formulas
- Document with Tables
So whether there is any ready to use module/ library which I can use with each type of document without doing image processing of image before converting it to text.
many thanks for help !!
-
Hi,
AFAIK, there's no official Qt module for that task.
Did you also consider using external tools and invoking them through QProcess ?
-
Hello SGaist,
Thank you very much for your fast reply.
Yes, actually I have developed a python script using OpenCV and pytesseract and call it using QProcess which can extract text from simple images as I mentioned before. But when try to extract text from complicated document image (such has document with handwritten data) then I get lot of errors in output text.
So I also wanted to know whether anyone knows any good OCR software on ubuntu machine which I can use with QT without much problem. Or do I have only one choice, first learn image processing using opencv and then make a good OCR software myself?
Many thanks ..:)
-
You might want to also consider the current trends of Machine/Deep Learning tools that are emerging for also this use case.
-
Hello @SGaist,
Thank you and yes, I am in contact with some experts in field of machine learning.
They do not know any solution in open source world which have solution for problem, I am facing in my application, and
I cannot afford commercial solution right now.Before starting development of solution which can solve my problem. I just want to make sure that whether there is anything already in market
which can help me to extract text from every type of document, so that I do not end up redesigning the things which i can directly use.kind regards
Saurabh -
There are things you can and should do. Usually one prepares images for Tesseract in some code that inverses negative images, turns them into black while maximizing contrast. Detecting columns is also an easy task - just scan pixels for the space between and pass the rectangles to OCR separately. Tables need just more code... Only recognizing handwritten text is hard, very hard.
-
@mvuori said in OCR with QT:
There are things you can and should do. Usually one prepares images for Tesseract in some code that inverses negative images, turns them into black while maximizing contrast. Detecting columns is also an easy task - just scan pixels for the space between and pass the rectangles to OCR separately. Tables need just more code... Only recognizing handwritten text is hard, very hard.
Hello @mvuori ,
Thank you very much for the reply. I think I have got my answer. That I need to do some processing before feeding my image Tesseract.
-
You may give this one a try. I have used it a lot with QT last year and had some success https://www.bisok.com/grooper-data-capture-method-features/multi-pass-ocr/. Hope this helps, good luck.