Preface:

OCR character recognition has a good application at present, there are also a lot of character recognition software, but the software is user-oriented. For our technical personnel, sometimes it is unavoidable to add text recognition in computer vision tasks, such as license plate number recognition, ticket recognition, so software is useless to us, we need to achieve text recognition by ourselves.

Tesseract and EasyOCR are two major open source frameworks for word recognition. This article discusses the main differences between Tesseract and EasyOCR using the Python API, including comparison in installation, usage examples, accuracy, and reasoning speed.

Use the sample

Tesseract

PIP install Pytesseract Pillow

Example:

from PIL import Image

import pytesseract

text=pytesseract.image_to_string(Image.open(filename))

print(text)

This is just a simple example, in practical application, the image is not ideal, and it needs to be preprocessed to better identify the image. Such as the removal of salt and pepper noise, the removal of interference, such as in the license plate recognition will also use the rectangular frame detection frame out of the location of the license plate, and enlarge, in order to better identify the number plate.

EasyOCR

PIP install easyOCr

Use the sample

import easyocr

reader = easyocr.Reader([‘ch_sim’, ‘en’])

text = reader.readtext(‘filename’)

print(text)

Note: EasyOCR also outputs the coordinates of the text in the picture.

accuracy

An experiment was carried out in reference link [2] using Tesseract and EasyOCR with 1000 alphanumerical images and 1000 numeric images respectively.

The input image with letters is shown below:

The input image with numbers is shown below:

The accuracy of the following two open source frameworks is compared through the test

Tesseract does a better job of recognizing letters, while EasyOCR does a better job of recognizing numbers, as shown above.

In addition, they have completely different problems in recognizing certain characters. Tesseract, for example, tends to identify something like 29977.23 as 2997.23, or carrier as Cartier. EasyOCR, on the other hand, is more likely to identify 94268.1 as 94268, or Advances as ATVances. These two examples of word recognition show the preference of the two frameworks for single letters.

Reasoning speed

In terms of speed, Tesseract outperformed EasyOCR on cpus, while EasyOCR outperformed EasyOCR on Gpus.

conclusion

Tesseract performed better at letter recognition, while EasyOCR performed better at numbers. If the image contains a lot of letters, consider Tesseract. In addition, the output of EasyOCR is lowercase. Tesseract should also be used if uppercase is important for processing. On the other hand, if the image contains a lot of numbers, EasyOCR is recommended.

Refer to the link

Blog.csdn.net/fatesunlove…

Medium.com/swlh/ocr-en…

A summary PDF of the following articles can be obtained by replying to the keyword “Technical Summary” in the public account.

Other articles

Summary of computer vision terms (a) to build the knowledge system of computer vision

Summary of under-fitting and over-fitting techniques

Summary of normalization methods

Summary of common ideas of paper innovation

Summary of efficient Reading methods of English literature in CV direction

A review of small sample learning in computer vision

A brief overview of intellectual distillation

Optimize the read speed of OpenCV video

NMS summary

Loss function technology summary

Summary of attention mechanism technology

Summary of feature pyramid technology

Summary of pooling techniques

Summary of data enhancement methods

Summary of CNN structure Evolution (I) Classical model

Summary of CNN structural evolution (II) Lightweight model

Summary of CNN structure evolution (iii) Design principles

How to view the future trend of computer vision

Summary of CNN visualization technology (I) – feature map visualization

Summary of CNN visualization Technology (ii) – Convolutional kernel visualization

CNN Visualization Technology Summary (iii) – Class visualization

CNN Visualization Technology Summary (IV) – Visualization tools and projects