BlinkID / blinkid-ios

Everything you need to add AI-driven ID scanning into your native iOS app.
https://microblink.com/products/blinkid
384 stars 89 forks source link

Image quality with UsdlCombinedRecognizer #127

Closed kryzhikh closed 6 years ago

kryzhikh commented 6 years ago

Hi guys!

I'm using UsdlCombinedRecognizer. It scans the license front side and then switches to back side scanning (the barcode). The scanning itself works awesome, but the image quality of the front side in most times is rather low. It calls scanningViewController(_, didOutputMetadata) just once and I can't make it redo the front side scanning in this scan session, or choose the sample when the frameQuality is enough. That'd be cool if we had some setting like 'minimumFrameQuality' so that it will return image metadata only when the frame quality >= minimum. Or maybe there is something else how I can influence the image quality?

ninjudd commented 6 years ago

Is there a workaround for this? It seems that the scanning happens too early sometimes, before the user has finished moving their license to the center of the camera frame.

kryzhikh commented 6 years ago

I ended up using 2 recognizers - Detector recognizer with id1Card specification for the front side and usdl recognizer for the back side to scan the barcode. With detector recognizer you're able to filter low quality samples with PPImageMetadata frameQuality() method

dgust6 commented 6 years ago

HI @kryzhikh and @ninjudd

Can you please check which version you are using? v2.13.0. Improved the quality of images returned by PPUsdlCombinedRecognizer. Your solution should also work as it allows frame quality check, however be aware that frame quality drops on images with poor lightning so we suggest testing it in poorer conditions.

kryzhikh commented 6 years ago

Hi @Pickles112358 We're using 2.14.0 and PPUsdlCombinedRecognizer still gives low image quality. Basically, as far as I can see, it just takes a photo as soon as it gets the DL edges and that's it. In most cases the image is not well focused (blurry)

culoi commented 6 years ago

Hello @kryzhikh

You can check out this property: numStableDetectionsThreshold It sets the number of subsequent close detections must occur before treating document detection as stable. The default is 1. Larger number guarantees more robust document detection at price of slower performance. https://github.com/BlinkID/blinkid-ios/wiki/Using-Detector-recognizer#initializing-ppdetectorsettings

Regards

culoi commented 6 years ago

Closing the issue, please reopen if you have additional questions or contact us directly at support@microblink.com