Amy
Amy

Reputation: 21

Tesseract - How to extract text from the image for the input coordinates?

I need to input image and coordinates. The text present in the input coordinate must be read as output. How to do this using node-tesseract?

Upvotes: 2

Views: 7625

Answers (2)

SPlatten
SPlatten

Reputation: 5760

I know this is an old thread, however I had the same requirement, couldn't find a solution so I've modified the module and posted onto Git:

https://github.com/desmondmorris/node-tesseract/issues/46

Upvotes: 0

Pang Ho Ming
Pang Ho Ming

Reputation: 1319

You need to look into the .hocr file returned from Tesseract(You can google hocr for more info first). The .hocr includes all the bounding box of the text(x, y, width, height, language etc.). Then calculate all boxes locate inside the coordinates you get from input.

Reference: http://gamemath.com/2011/09/detecting-whether-two-boxes-overlap/

Update:

I did some researches for you. Here you are the "best" (most stars) github repo in Javascript you can find on Github

https://github.com/search?utf8=✓&q=tesseract+language%3Ajavascript

and the best one is tesseract.js with over 10000 stars and still having commits recently

https://github.com/naptha/tesseract.js

enter image description here

the part I highlighted is .hocr (tesseract.js named it html)

Upvotes: 5

Related Questions