SubhamTyagi / android-ocr

Tesseract based OCR for android
Apache License 2.0
401 stars 67 forks source link

Recognize simple handwriting #28

Open klasrocket opened 3 years ago

klasrocket commented 3 years ago

I've been looking for a tool that could work similarly to a QR code scanner but without the need printing labels, both for the ease of marking but also for the possibility easily to put marks on ie metal or or something that won't fit through a printer.

My thought was to be able to set up a 5-10 character code series that you could have a conversion table for, maybe a website that could redirect to anywhere. As it's only random characters I guess the language settings are for no use, maybe even messes things up while trying to find sentences, could this be a problem?

Made some test with gImageReader on Linux with tesseract 4.1.1 that worked well and made me think recognizing handwriting is possible, but didn't manage to replicate this with OCR app.

gImageReader (you see the recognized text at the top left, very small but correct ) Screenshot from 2021-04-11 10-07-11

OCR app, no success: Screenshot_20210411-101316_OCR

Screenshot_20210411-101309_OCR

Are there any settings that could be adjusted to improve this, did have a look around the settings menu but didn't find any obvious, or is there a major difference that makes this hard/impossible with OCR app?

klasrocket commented 3 years ago

Ok, seems like this (recognizing random characters, especially not handwritten) is really not what tesseract is intended for but still it seems possible and PSM (page segmentation mode) seems to play an important role, is it possible to play around with different PSM settings in OCR app? If not maybe I could recompile it with a different setting?

SubhamTyagi commented 3 years ago

Try this apk,

app-arm64-v8a-debug.zip

SubhamTyagi commented 3 years ago

try new version with Page Segmentation Mode found in Settings app-arm64-v8a-debug-v21.zip

klasrocket commented 3 years ago

Nice, thx for your effort. I managed to alter compile and try the following modes yesterday which seemed promising but did not get any of them to recognize my full 6char code: PSM_RAW_LINE PSM_SINGLE_WORD PSM_SINGLE_CHAR

Managed to recognize a few chars though, so at least some progress.

I guess I'll have to dig a bit more into documentation and testing with Tesseract, but really uesful to easily switch mode in the settings menu! By the way, installed the apk in the post above but didn't get any new options in the settings but worked fine after pulling the commit and compile it myself.