| class info |
| com.huawei.hms.mlplugin.card.bcr.MLBcrCapture |
| Represents the bank card recognition plug-in. |
| Return type | Method name |
| void | captureFrame(android.content.Context context, MLBcrCapture.Callback callback) |
| Method |
| public void captureFrame(android.content.Context context, MLBcrCapture.Callback callback) |
| Recognizes bank card information in camera streams. |
Parameters
| Parameter name | Parameter desc |
| context | Context. |
| callback | Recognition result callback. |
Sample Code
- MLBcrCaptureConfig config = new MLBcrCaptureConfig.Factory()
- // Set the recognition screen orientation.
- // MLBcrCaptureConfig.ORIENTATION_AUTO: adaptive mode. The physical sensor decides the recognition screen orientation.
- // MLBcrCaptureConfig.ORIENTATION_LANDSCAPE: landscape mode. The screen width is greater than the screen height.
- // MLBcrCaptureConfig.ORIENTATION_PORTRAIT: portrait mode. The screen height is greater than the screen width.
- .setOrientation(MLBcrCaptureConfig.ORIENTATION_AUTO)
- .create();
- MLBcrCapture bankCapture = MLBcrCaptureFactory.getInstance().getBcrCapture(config);
- // Recognizes bank cards. You can specify the class instance for implementing the callback API.
- bankCapture.captureFrame(this, callback);