Recognize Vietnamese text using Tesseract OCR     (English | Vietnamese)

Download and uncompress the Vietnamese language data pack for Tesseract into tesseract installation folder; the vie. files will be placed in the tessdata subdirectory. Tesseract currently can only recognize uncompressed TIFF images. To perform OCR on an image using Tesseract:

tesseract vietsample.tif output –l vie

The language data were generated specifically for Times New Roman, Arial, Verdana, and Courier New fonts. Therefore, the recognition would have better success rate for images having similar font glyphs. OCRing images that have font glyphs look different from the supported fonts generally will require training Tesseract to create another language data pack specifically for those typefaces.

 

There are a few free GUI frontend programs for Tesseract OCR engine: VietOCR, an open-source Java/.NET application, provides recognition support for TIFF, JPEG, GIF, PNG, and BMP image formats; and FreeOCR is a .NET program, extending the engine with the capability of scanning in documents and recognizing compressed TIFF files. By printing via the Microsoft Office Document Image Writer printer, Windows applications can produce compressed TIFF files, which then can be used for OCR practice with FreeOCR or VietOCR.

 

TIFF images to be OCRed should be scanned at resolution from at least 200 DPI (dot per inch) to 400 DPI. Scanning at higher resolutions will not necessarily result in better recognition accuracy, which currently can be higher than 97% for Vietnamese, and the next release of Tesseract may improve it even further. Even so, the actual rates still depend greatly on the quality of the scanned image. The settings for scanning are typically 300 DPI and 1 bpp (bit per pixel) black&white or 8 bpp grayscale TIFF format.

 

The recognition errors can be classified into three categories. Many of the errors are related to the letter cases — for example: hOa, nhắC — which can be easily corrected by popular Unicode text editors. Many other errors are a result of the OCR process, such as missing diacritical marks, wrong letters with similar shape, etc. — huu – hưu, mang – marg, h0a – hoa, la – 1a, uhìu - nhìn. These can also be easily fixed by Vietnamese spell checker programs.

 

The last category of  errors is the most difficult to detect because they are semantic errors, which means that the words are valid entries in the dictionary but are wrong in the context — e.g., tinh – tình, vân – vấn. These errors require the editor to read though and manually correct them according to the original image.

 

Following are instructions on how to correct the OCR errors in a speedy and effective way the first two groups of errors using VietPad text editor. The process can be summarized as follows:

 

  1. Group lines. The lines need to be grouped to the paragraph they belong, as being OCRed, each line becomes a separate 1-line paragraph. Use Remove Line Breaks function under Format menu. Note that this operation may not be needed for poems.
  2. Select Change Case, also under Format menu, and choose Sentence case to correct most of the letter case errors. Locate and fix the rest of remaing letter case errors.
  3. Correct the mispelled errors using the Spell Check under Tool menu.

 

Through the above steps, the accurary can exceed 99%. The remaining, sematic errors are few, but it requires a human editor to read though and make necessary edits to make the document like the original scanned document, and error-free if desired.

 

If there is any questions, please post in VietUnicode Forum.