简体   繁体   English

使用 Flutter Google-ml-kit 文本识别在相机预览上扫描/分析的矩形框

[英]Rectangular box to scan/analyze on the camera preview with Flutter Google-ml-kit Text Recognition

There's an example app using on-device Text Recognition of Google ML Kit: https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/example有一个使用 Google ML Kit 的设备上文本识别的示例应用程序: https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/example

I'm using the "text recognition" part of that example app in my app and it works good.我在我的应用程序中使用了该示例应用程序的“文本识别”部分,它运行良好。 The only thing I need to do but can't do is that I want to show a rectangular box on the camera preview and only want to recognize texts inside this box.我唯一需要做但不能做的是我想在相机预览上显示一个矩形框,并且只想识别这个框内的文本。 Other parts of the preview should be ignored.应忽略预览的其他部分。 Otherwise, all the text in the preview would be recognized which is bad for my use case.否则,将识别预览中的所有文本,这对我的用例不利。

It's easy to show a rectangular box on the camera preview but I don't know how to only analyze the part in that rectangular box instead of the whole preview.在相机预览上显示一个矩形框很容易,但我不知道如何只分析该矩形框中的部分而不是整个预览。 Any help please?请问有什么帮助吗?

There are two ideas you can consider:您可以考虑两个想法:

(1) Crop your camera preview down to only the rectangular box and feed that cropped image to the ML Kit API. (1) 将您的相机预览裁剪为仅矩形框,并将裁剪后的图像提供给 ML Kit API。 (2) ML Kit's Text Recognition API returns a bounding box on Android (and frame on iOS ). (2) ML Kit 的文本识别 API 在Android (和iOS上的frame )上返回一个边界框。 You can use that to determine if any of the text recognition results falls into or overlaps with your rectangular box.您可以使用它来确定是否有任何文本识别结果落入或与您的矩形框重叠。 Depending on your use case and the input image, this approach may not be ideal since it can return text recognition result for text not entirely inside your rectangle.根据您的用例和输入图像,这种方法可能并不理想,因为它可以为不完全位于矩形内的文本返回文本识别结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter:带摄像头插件的 Live ml 套件文本识别 - Flutter: Live ml kit text recognition with camera plugin Flutter - Google ML 套件 - 文本识别 - 无法正确读取机读区 - Flutter - Google ML kit - Text Recognition - Unable to read MRZ correctly 在 Flutter 中使用 Google ML-Kit On-Device 文本识别 - Using Google ML-Kit On-Device Text Recognition in Flutter 如何通过 Firebase ML 套件文本识别扫描七段显示器? - How To Scan a Seven Segment Display by Firebase ML kit Text Recognition? 使用机器学习套件在 flutter 中进行人脸识别 - Face Recognition in flutter using ML Kit google_ml_kit - 如何在编译时强制下载文本识别模块? - google_ml_kit - how to force download of text recognition module at compile? Flutter Google ML Kit 人脸检测未检测到 - Flutter Google ML Kit Face Detection not detecting 如何使用firebase ML kit进行非英文文字识别? - how to use firebase ML kit for text recognition of non enlgish languages? 如何从 google ml kit 人脸检测器拍摄相机照片? - How to take camera picture from google ml kit face detector? 在 Flutter 中获取面部轮廓后交换面部(Google ML 套件) - Swapping Face After Getting Face Contours In Flutter (Google ML Kit)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM