Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handwritten text recognition with javascript [closed]

I am trying to implement a system to identify/detect words of a handwritten text in a image. I need to recognize the words in the text. But I feel it is impossible since the images are not readable even for me. For now what I need is to separate out the words. I only need to figure out there is a word. When the user select an area, the system should select only a single word in the image.

My Question is : Is it doable using JavaScript?

Here is a sample Image. enter image description here

like image 558
Isuru Herath Avatar asked Jan 02 '15 09:01

Isuru Herath


1 Answers

JS+Canvas and a basic implementation of the Viola-Jones face-recognition technique.
With some manuscript like that? I think you'll get really bad results.

You need first to detect the global horizontal inclination. (By getting the inclination you can simultaneously retrieve the line height.)
Create a 100% horizontal grid runner like:

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

where 0 checkes for light and 1 for dark areas. Let it run over your image-selection data from top-to-bottom, and to all inclinations (i.e. +-15deg max).
A positive match is when your (stripes)grid returns the threshold contrast density that matches its raster. If the runner returns no match increase it's size and let it run again.
You need to account for mistakes so you need to store every possible positive match. After you're done with all sizes and inclinations you just pick the one that resulted with more matches.

enter image description here

Now you'll have the general horizontal inclination and the line height.

Now you need to define the vertical letter inclination. At the same time you can retrieve the blank spaces.
Same technique. You let run a vertical runner line-by-line (you know the line-height)

0101010
0101010
0101010
0101010
0101010

starting from 0 left to the most right. No match? change degree. Let run again.
Retrieve the run that collected more matches. You have the letter inclination.
let it run over the same line of text and collect all the information about the highlight gaps between the dark areas.

enter image description here

like image 68
Roko C. Buljan Avatar answered Oct 29 '22 16:10

Roko C. Buljan