Ml Kit无法检测到Passport MRZ代码?

时间:2018-05-17 09:30:25

标签: android firebase firebase-mlkit

我正在使用这部分代码进行检测,但无论我做什么都无法检测机读区(MRZ)。

    String recognizedText = firebaseVisionCloudText.getText();

for (FirebaseVisionCloudText.Page page: firebaseVisionCloudText.getPages()) {
    List<FirebaseVisionCloudText.DetectedLanguage> languages =
            page.getTextProperty().getDetectedLanguages();
    int height = page.getHeight();
    int width = page.getWidth();
    float confidence = page.getConfidence();

    for (FirebaseVisionCloudText.Block block: page.getBlocks()) {
        Rect boundingBox = block.getBoundingBox();
        List<FirebaseVisionCloudText.DetectedLanguage> blockLanguages =
                block.getTextProperty().getDetectedLanguages();
        float blockConfidence = block.getConfidence();
    }
}

它是否可能无法读取字体?如果有,是否有添加字体的选项? 还可以将Ml Kit与Tesseract结合使用吗?

1 个答案:

答案 0 :(得分:2)

它是否可能无法读取字体?

有可能。也就是说,像驾驶执照这样的东西可以用ML Kit进行文本识别。您是否尝试在用例上运行quick starter appcodelab

是否有添加字体的选项?

您无法直接添加。我们将不得不用该字体更新模型。如果您的用例无效,请随时联系Firebase Support,我们将很乐意了解您的使用案例并更新模型。

还可以将Ml Kit与Tesseract结合使用吗?

当然。您必须在ML Kit API调用之外自己完成。