Improved Python3.x:pytesseract recognition rate (sample training)
1, download and install version 3.05 of Tesseract
Address:https://sourceforge.net/projects/tesseract-ocr/
2, if your training material is a lot of non-TIF format pictures, the first thing to do is to merge such pictures (personally think the more material, the basic of each letter and number covering the training out of the recognition rate is better)
Download this tool:vietocr.net-3.3.zip
Address:http://sourceforge.net/projects/vietocr/files/latest/download?source=files
First of all, the conversion of Jpg,gif,bmp to TIF, this with the use of self-drawing can be. Then use vietocr.net-3.3 to make multiple TIF merge.
3,make Box Files. Open a command line in the directory where the Orderno.tif is located, enter
C:\Program files\tesseract-ocr>tesseract.exe Lang.jhy.exp8.TIF lang.jhy.exp8 batch.nochop Makebox
4, open the Orderno.tif file with Jtessboxeditor, it is necessary to remember that the 2nd step generated orderno.box to the same directory as the Orderno.tif file. Correct the text one after the other and save it.
Download the Jtessboxeditor tool for each self-correcting (note that there are nextpage to correct each page)
Address:http://sourceforge.net/projects/vietocr/files/
5,run tesseract for Training. Enter the command:
C:\Program Files\tesseract-ocr>tesseract.exe Lang.jhy.exp8.TIF LANG.JHY.EXP8 nob
Atch Box.train
6,compute the Character Set. Enter the command:
C:\Program Files\tesseract-ocr>unicharset_extractor.exe Lang.jhy.exp8.box
Extracting Unicharset from Lang.jhy.exp8.box
Wrote Unicharset file./unicharset.
7. Create a new file "Font_properties". In the case of version 3.01, you will need to create a new file with the name "Font_properties" in the directory and enter the text: (Here jhy is the middle field of LANG.JHY.EXP8)
Jhy 1 0 0 1 0
8,clustering. Enter the command:
C:\Program Files\tesseract-ocr>cntraining.exe lang.jhy.exp8.tr
Reading lang.jhy.exp8.tr ...
Clustering ...
Writing Normproto ...
9, at this time, in the directory should generate a number of files, the Unicharset, inttemp, Normproto, pfftable These files prefixed with "selfverify." Then enter the command:
It must be determined that 1, 3, 4, 5, 13 rows of data is not-1, then a new dictionary is generated.
The "Selfverify.traineddata" file under this directory is copied to the "Tessdata" directory under the Tesseract program directory.
This dictionary can then be used to identify, for example:
Tesseract.exe test.jpg out–l selfverify
Improved Python3.x:pytesseract recognition rate (sample training)