How Does Optical Character Recognition (OCR) Work?

Описание к видео How Does Optical Character Recognition (OCR) Work?

Today, we’re going to take a look at OCR - or optical character recognition. OCR is a technology that converts printed text into a digital format. The variety of different fonts and ways of writing a single character makes this problem hard to solve. Before an OCR algorithm can be chosen, the image must undergo some preprocessing.In this step, the document is straightened, despeckled, and converted from color to a binary image - an image where the only two colors are black and white. The feature detection algorithm identifies a character by analyzing the lines and strokes that make it.
The second approach, pattern recognition, works by identifying the character as a whole. We can identify a line of text by looking for rows of white pixels with rows of black pixels in between. In the same way, we can identify where an individual character begins and ends. Next, we convert the image of the character into a binary matrix where white pixels are 0s and black pixels are 1s.Then, by using the distance formula, we can find the distance from the center of the matrix to the farthest 1. We then create a circle of that radius and split it up into more granular sections. At this point, the algorithm will compare every single subsection against a database of matrices representing characters with various fonts to find the character it statistically has the most in common with. Doing this for every line and every character makes it easy to bring printed media into the digital world.

Комментарии

Информация по комментариям в разработке