目录

class info
com.huawei.hms.mlplugin.card.bcr.MLBcrCapture
Represents the bank card recognition plug-in.

Public Method Summary

Return typeMethod name
voidcaptureFrame(android.content.Context context, MLBcrCapture.Callback callback)

Public Methods

Method
public void captureFrame(android.content.Context context, MLBcrCapture.Callback callback)
Recognizes bank card information in camera streams.

Parameters

Parameter nameParameter desc
contextContext.
callbackRecognition result callback.

Sample Code

  1. MLBcrCaptureConfig config = new MLBcrCaptureConfig.Factory()    
  2.     // Set the recognition screen orientation.
  3.     // MLBcrCaptureConfig.ORIENTATION_AUTO: adaptive mode. The physical sensor decides the recognition screen orientation.
  4.     // MLBcrCaptureConfig.ORIENTATION_LANDSCAPE: landscape mode. The screen width is greater than the screen height.
  5.     // MLBcrCaptureConfig.ORIENTATION_PORTRAIT: portrait mode. The screen height is greater than the screen width.
  6.     .setOrientation(MLBcrCaptureConfig.ORIENTATION_AUTO)
  7.     .create();
  8. MLBcrCapture bankCapture = MLBcrCaptureFactory.getInstance().getBcrCapture(config);
  9. // Recognizes bank cards. You can specify the class instance for implementing the callback API.
  10. bankCapture.captureFrame(this, callback);