tesseract

how to detect orientation of a scanned document?

牧云@^-^@ 提交于 2019-12-05 13:07:55
I'd to detect and, if necessary, correct the orientation of a scanned document image. I am already able to deskew documents, however it still might occur, that a document is upside down and it needs to be rotated by 180°. Using tesseract 's layout analysis feature it should be possible to determine a document's orientation using this code: tesseract::TessBaseAPI api; api.Init(argv[0], "eng"); api.SetImage(img); api.SetPageSegMode(tesseract::PSM_AUTO_OSD); tesseract::PageIterator* it = api.AnalyseLayout(); tesseract::Orientation orient; tesseract::WritingDirection dir; tesseract::TextlineOrder

How to integrate Tesseract OCR Library to a C++ program

陌路散爱 提交于 2019-12-05 12:55:35
I am trying to use Tesseract OCR Library in order to create a program to read pictures of elevator floor numbers. I haven't found any example on how to include the Tesseract Library into a C++ file. Something like: #include "tesseract.h" I am using Tesseract v 3.00 on Ubuntu 10.10. VSOverFlow The PlatformStatus Page has some comments on how to install it. It has dependencies (leptonica) which also need to be installed. Another solution also linked from the above discussion has similar details for other linux distributions. When it comes to linking with your program, this post has some

Camera Preview and OCR

六月ゝ 毕业季﹏ 提交于 2019-12-05 11:36:34
I am new to android development - I'm using Xamarin. I am trying to write an application that initiates the camera preview, and then constantly scans the incoming frames for text (I am using Xamarin.Tesseract from NuGet). In other words, I don't want to make the user take a photo and then do the OCR analysis, instead I want them to just point the video camera at some paper with text on it, i'll continually do the OCR analysis until I detect the specific text I'm searching for) at which point I'll give a big thumbs up to the user. This is the approach I have gone down so far: Initialise the

How to read a table data from Images using Tesseract OCR?

感情迁移 提交于 2019-12-05 10:57:01
Is anyone aware how read & parse any table data from the image. I am using asp.net application & I have successfully read data using Tesseract-OCR API but not able to read the table from Image. Please give solution with c# code. 来源: https://stackoverflow.com/questions/37746394/how-to-read-a-table-data-from-images-using-tesseract-ocr

Tesseract error. Illegal min or max specification

﹥>﹥吖頭↗ 提交于 2019-12-05 08:37:01
Trying to run sample code from here http://tess4j.sourceforge.net/codesample.html I got an error saying Error: Illegal min or max specification! signal_termination_handler:Error:Signal_termination_handler called:Code 5002 I found solution e.g. here https://code.google.com/p/tesseract-ocr/issues/detail?id=228 ppl say that setting locale is enough to get rid of error. My problem is that I write it in Java not C++ and I cannot find anywhere how I can set locale in my code as they did it like that #include <locale.h> setlocale (LC_NUMERIC, "C"); I was trying to use setTessVariable(String, String)

Read text from image using OCR for the image which have two columns or three columns of data using python

独自空忆成欢 提交于 2019-12-05 07:14:21
问题 In the example image (just a reference, my images will be of same pattern) a page which have full horizontal text and other have two horizontal column of text. How to automatically detect the pattern of the document and read one after the other column of data in python?. I am using Tesseract OCR with Psm 6, where it is reading horizontally which is wrong. 回答1: One way to accomplish this is using morphological operations and contour detection. With the former you essentially "bleed" all

Tesseract OCR: Recognize complete dictionary words only

[亡魂溺海] 提交于 2019-12-05 06:49:02
问题 I'm using the tesseract OCR plugin for phonegap: https://github.com/jcesarmobile/PhonegapOCRPlugin/i I'm trying to config tesseract to recognize complete dictionary words only. That is: no special characters, no suffixes or prefixes etc. As the tessdata folder from this project doesn't contain any configs I thought I'd set configs on init. Right now I'm trying to set configs by modifying claseAuxiliar.mm but I can't say I've noticed any difference, this might be because the configs are wrong

Tesseract empty page

和自甴很熟 提交于 2019-12-05 06:43:53
问题 I use tesseract for detecting characters on image. try { using (var engine = new TesseractEngine(@"C:\Users\ea\Documents\Visual Studio 2015\Projects\ocrtTest", "eng", EngineMode.Default)) { using (var img = Pix.LoadFromFile(testImagePath)) { Bitmap src = (Bitmap)Image.FromFile(testImagePath); using (var page = engine.Process(img)) { var text = page.GetHOCRText(1); File.WriteAllText("test.html", text); //Console.WriteLine("Text: {0}", text); //Console.WriteLine("Mean confidence: {0}", page

image_to_string doesn't work in Mac

拜拜、爱过 提交于 2019-12-05 06:22:44
I'm trying to follow this example of pytesser ( link ) in a Mac Maverick. >>> from pytesser import * >>> im = Image.open('phototest.tif') >>> text = image_to_string(im) But, in the last line I get this error message: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pytesser.py", line 31, in image_to_string call_tesseract(scratch_image_name, scratch_text_name_root) File "pytesser.py", line 21, in call_tesseract proc = subprocess.Popen(args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite)

Adding New Fonts to Tesseract 3

Deadly 提交于 2019-12-05 06:07:41
I'm trying to add new fonts to tesseract ocr. I'm following this tutorial but I'm having some problems. Here's what I've done so far: Create training document convert eng.myfont.exp0.pdf eng.myfont.exp0.tif Train Tesseract tesseract eng.myfont.exp0.tif eng.myfont.exp0 batch.nochop makebox This created my eng.myfont.exp0.box file. I open the file with moshpytt and make sure it was detected correctly. Feed the box file back into tesseract tesseract eng.myfont.exp0.tif eng.myfont.exp0.box nobatch box.train.stderr I have this result: Tesseract Open Source OCR Engine v3.03 with Leptonica APPLY