BlinkID / blinkid-in-browser

BlinkID In-browser SDK for WebAssembly-enabled browsers.
https://microblink.com/blinkid
59 stars 30 forks source link

Documentcode is not getting returned #50

Closed sachin321123 closed 3 years ago

sachin321123 commented 3 years ago

Hello Team, The documentcode in mrz object is not getting returned, so I am not able to identify which document has the user uploaded(Passport or any other national ID).

vjekoart commented 3 years ago

Hi @sachin321123,

Thank you for the report.

Could you check if our recognizers support the documents you're trying to scan? The full list of documents supported by the BlinkID can be seen in the docs/BlinkIDRecognizer.md file.

Also, could you provide information about the recognizer you're using and which type of integration you have? That is, are you using our UI component, or you're directly creating instances of recognizer and recognizer runner classes?

Sincerely, Vjekoslav

sachin321123 commented 3 years ago

Hi @vjekoart I just checked the list of document. I am scanning the ID Card of UAE which is supported. Also, I am directly creating the instances of your recognizer and runner classes. Please find the code which can help more:-

const genericIDRecognizer = await BlinkIDSDK.createBlinkIdRecognizer(sdk);
const idBarcodeRecognizer = await BlinkIDSDK.createIdBarcodeRecognizer(sdk);

const recognizerRunner = await BlinkIDSDK.createRecognizerRunner(
  // SDK instance to use
  sdk,
  // List of recognizer objects that will be associated with created RecognizerRunner object
  [genericIDRecognizer],      
  false
);
// 3. Prepare image for scan action - keep in mind that SDK can only process images represented in
//    internal CapturedFrame data structure. Therefore, auxiliary method "captureFrame" is provided.   
let file = null;
const imageRegex = RegExp(/^image\//);
for (let i = 0; i < fileList.length; ++i) {
  if (imageRegex.exec(fileList[i].type)) {
    file = fileList[i];
  }
}

const imageFrame = BlinkIDSDK.captureFrame(document.getElementById(name)); const processResult = await recognizerRunner.processImage(imageFrame); let genericIDResults; if (processResult !== BlinkIDSDK.RecognizerResultState.Empty) { genericIDResults = await genericIDRecognizer.getResult(); }

Kindly let me know if anything else is required from my end.

vjekoart commented 3 years ago

Hi @sachin321123,

Thank you for the provided information.

Are you getting the correct information about the document type in the ClassInfo property?

Also, I can see that the UAE ID card has the MRZ on the backside of a document. However, it looks that you're providing only one image to the BlinkIdRecognizer. Since that recognizer always has to scan the front side, it doesn't look strange that the MRZ field inside the results is not filled properly.

Are you trying to scan both document sides with a BlinkId recognizer?

Sincerely, Vjekoslav

sachin321123 commented 3 years ago

Hi @vjekoart

Thank you for the information. My requirement is such that I should allow the user to upload the doc and should not allow him to use the web camera. So I have only single side scan option available for me.

I need to inform the user if he has uploaded something else in place of the frontside of UAE ID. Can I get some parameter to identify that and immediately display the false message or Shall I need to make some changes in the recognizer?

Please let me know if anything else is required.

Regards, Sachin

vjekoart commented 3 years ago

Hi @sachin321123,

In that case, I would suggest that you rely on the ClassInfo property inside the results.

Once the scanning process is complete, you should get results from the recognizer. Results object contains the classInfo property, which has information about the document type that has been scanned. You can see all possible values of classInfo property in this file.

I hope this helps.

Sincerely, Vjekoslav

sachin321123 commented 3 years ago

Thanks @vjekoart . I am able to identify the type of document now. I am going to close this issue now.