Handwritten text recognition with javascript

I am trying to implement a system for identifying / detecting handwritten words in an image. I need to recognize the words in the text. But I feel that this is impossible, because the images are not readable even for me. At the moment, I need to separate the words. I only need to find out if there is a word. When the user selects an area, the system should select only one word in the image.

My question is: is this possible with JavaScript?

Here is an example image. enter image description here

+5
source share
1 answer

JS + Canvas and the base implementation of the Viola-Jones face recognition method .
With some kind of manuscript? I think you will get really bad results .

You need to first determine the global horizontal slope . (Once you get the slope , you can get the row height at the same time .)
Create a 100% horizontal mesh runner, for example:

0000000000... 1111111111... 0000000000... 

where 0 checks for light and 1 for dark areas . Let it execute the data of your image selection from top to bottom and to all inclinations (i.e. + -15deg max).
A positive match is when your grid (stripes) returns a threshold contrast density corresponding to its raster value. If the runner does not return any match, increase its size and let it start again.
You need to consider errors, so you need to keep all possible positive matches. After you are done with all sizes and inclinations, you simply select the one that led to more matches.

enter image description here

You will now have a general horizontal slope and line height .

Now you need to determine the vertical slope of the letter . At the same time, you can get empty space .
The same technique. You can run the vertical runner one at a time (you know the line height)

 0101010 0101010 0101010 0101010 0101010 

starting from 0 on the left to the right. Does not match? change degree. Let it run again.
Get a run that collects more matches. You have a penchant for writing.
let him run through the same line of text and collect all the information about the selection between the dark areas.

enter image description here

+5
source

Source: https://habr.com/ru/post/1210246/


All Articles