我已经查看了在Github上的Android OCR视觉样例,链接如下:https://codelabs.developers.google.com/codelabs/mobile-vision-ocr/index.html?index=..%2F..%2Findex#0
如何自动识别并选择信用卡号码,而不是手动输入呢?目前的receiveDetection方法为:
@Override
public void receiveDetections(Detector.Detections<TextBlock> detections) {
mGraphicOverlay.clear();
SparseArray<TextBlock> items = detections.getDetectedItems();
for (int i = 0; i < items.size(); ++i) {
TextBlock item = items.valueAt(i);
if (item != null && item.getValue() != null) {
Log.d("Processor", "Text detected! " + item.getValue());
}
OcrGraphic graphic = new OcrGraphic(mGraphicOverlay, item);
mGraphicOverlay.add(graphic);
}
}
@Override
public void release() {
mGraphicOverlay.clear();
}
我希望能有一种方法自动识别有效的信用卡号码(可以是任何像收据号码、账单订单号等),并在扫描后切换到另一个意图,并使用该值执行其他活动。