blinkinput / blinkinput-android

BlinkOCR SDK for Android
https://microblink.com/ocr
104 stars 29 forks source link

Fixed Detector Region - MinimumCharHeight #30

Closed delpes closed 5 years ago

delpes commented 5 years ago

Hi,

i am currently using your latest android code and modified the BlinkInputTemplatingSample to work with the type of card i am scanning:

mDocumentDetector = new DocumentDetector( DocumentSpecification.createFromPreset(DocumentSpecificationPreset.DOCUMENT_SPECIFICATION_PRESET_ID1_CARD));

Now i seem to be unable to find a way to have the scanning region ( and overlay) fixed (or at least set a minimum size). I want to achieve that the user places the camera as close as possible to the card to be scanned as it contains some very small text.

Also is there an example on how to use setMinimumCharHeight ? There are parts on the card i don't want the engine to recognize ( < 7 pt font size, white on blueish gradient) that are very close to the regions i need to have recognized ( 7pt, black/darkgrey on white). How can i achieve a faster and more optimized scanning process?

i1E commented 5 years ago

Hi @delpes,

if you don't set the scanning region on the RecognizerRunnerVeiw, then full camera frames will be scanned. If you want the user to place the camera as close as possible, you should not set the smaller scanning region. You can draw camera overlay rectangle which will suggest where to place the document. You can add overlay as a child to RecognizerRunnerView, like it is done here, or you can include the overlay directly in activity layout.

For setting the minimum char height, you can use method AbstractOCREngineOptions.setMinimumCharHeight, this is height in pixels on the image thet came to recognition. You should experiment with height and see which value gives the best results.

delpes commented 5 years ago

Thanks for your reply. So the CharHeight is variable/relative to the closeness of the objec the camera and the screen capabilities?

i1E commented 5 years ago

So the CharHeight is variable/relative to the closeness of the objec the camera and the screen capabilities?

That is true, this is setting for the OCR engine, it only knows about the image which came to recognition.

delpes commented 5 years ago

Thank you. Solved & Closed