Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 大多数情况下,OCR都在识别<;作为K,有办法解决这个问题吗?_Java_Android_Google Api_Ocr - Fatal编程技术网

Java 大多数情况下,OCR都在识别<;作为K,有办法解决这个问题吗?

Java 大多数情况下,OCR都在识别<;作为K,有办法解决这个问题吗?,java,android,google-api,ocr,Java,Android,Google Api,Ocr,我在这个链接中编写了一个代码,使用谷歌文本Api读取护照上的MRZ 一切正常,但大多数情况下,它从护照上的MRZ中读取

我在这个链接中编写了一个代码,使用谷歌文本Api读取护照上的MRZ

一切正常,但大多数情况下,它从护照上的MRZ中读取<作为K,并且没有读取MRZ上的所有88个字符

例如,假设OCR可以读取


p我在我的示例项目中使用同一个库的迁移版本,我从来没有遇到过问题。

它读取mrz文本的速度和正确性太高。在我尝试使用基于Google Tesseract的OCR库之前,在我的入门级手机上效果并不好。然后我将OCR库替换为谷歌MLKit文本识别,它可以清晰、快速地读取护照/身份证文本。我已经用MRZInfo解析读取的文本,验证字段是否正确

以下是我的实现示例:


获得更好的OCR库?这就是为什么计算机视觉不是一门解决问题的科学,为什么对于需要可靠识别的事物,我们使用条形码和类似技术而不是文本。你能为我推荐一个更好的OCR库吗?
    private void filterScannedText(GraphicOverlay graphicOverlay, Text.Element element) {
    GraphicOverlay.Graphic textGraphic = new TextGraphic(graphicOverlay, element, Color.GREEN);
    scannedTextBuffer += element.getText();
    String docPrefix;
    if(scannedTextBuffer.contains(StringUtil.TYPE_PASSPORT) || scannedTextBuffer.contains(StringUtil.TYPE_ID_CARD)) {
        graphicOverlay.add(textGraphic);
        docPrefix = scannedTextBuffer.contains(StringUtil.TYPE_PASSPORT) ? StringUtil.TYPE_PASSPORT : StringUtil.TYPE_ID_CARD;
        scannedTextBuffer = scannedTextBuffer.substring(scannedTextBuffer.indexOf(docPrefix));
        finishScanning(scannedTextBuffer);
    }
}