blinkcard / blinkcard-in-browser

21 stars 11 forks source link

Cancelling recognition after first side of card is scanned. #23

Open pavikrishna opened 10 months ago

pavikrishna commented 10 months ago

We only require user to scan the first of the card. Therefore upon successful scan of the first side, we cancelRecognition.

     onFirstSideResult: () => {
        videoRecognizer?.cancelRecognition();
      },

It is working as expected but was wondering if there is any downsides of doing this? Is there any other alternative solutions to the above? I see that this was a recommend solution on a previous post https://help.microblink.com/s/direct-article?Article=ka08W000000st3HQAQ. However this solution has drawbacks since it dose not work for all card types. I'm curious as to why the above link is the recommended solution vs just cancelRecognition.

pavikrishna commented 10 months ago

also the example in the docs is currently broken https://codepen.io/microblink/pen/YzpWGMw

AngTim commented 10 months ago

Hello Krishna,

Thank you for the inquiry. There are no downsides in the cancelRecognition event that you have implemented onFirstSideResult function if you wish only to scan the first side of the credit card. Unfortunately, there are not a lot of other solutions for single side scanning with the BlinkCard SDK since it does not include two separate recognizers which you can call depending on your use case SingleSideRecognizer and MultiSideRecognizer and only contains BlinkCardRecognizer which requires both sides of a document by default and that is why the help article suggests a workaround that could be easy to implement and understand for a first hand. We are aware that it is no the most applicable approach and that is why we have made the following disclaimer:

It is important to note that this setup works only on a specific set of credit cards, like the example above, which only contains the CVV information on the back of the document. To skip other credit cards with document fields organized differently, the recognizer settings would have to be updated, and maybe some other fields (extractIban, extractExpiryDate or extractOwner) skipped as well. Therefore the solution is not flexible and reproducible in many cases but works well in a specific situation on the same set of credit cards.

The issue with the codepen example has been raised to our engineers and should be resolved soon. Please feel free to reach out if you have any additional questions or issues.

Kind regards, Angelo Web Support Specialist