将Vision VNTextObservation转换为String [英] Converting a Vision VNTextObservation to a String

查看:691
本文介绍了将Vision VNTextObservation转换为String的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看Apple的 Vision API文档,我看到了几个类与 UIImages中的文本检测有关

I'm looking through the Apple's Vision API documentation and I see a couple of classes that relate to text detection in UIImages:

1) class VNDetectTextRectanglesRequest

2) class VNTextObservation

看起来他们可以检测到字符,但我没有看到对字符做任何事情的方法。一旦检测到字符,您将如何将它们转换为可以通过 <解释的内容code> NSLinguisticTagger

It looks like they can detect characters, but I don't see a means to do anything with the characters. Once you've got characters detected, how would you go about turning them into something that can be interpreted by NSLinguisticTagger?

这是一篇简短概述 愿景

Here's a post that is a brief overview of Vision.

感谢您阅读。

推荐答案

SwiftOCR

我只是让SwiftOCR使用少量文本。

I just got SwiftOCR to work with small sets of text.

https: //github.com/garnele007/SwiftOCR

使用

https://github.com/Swift-AI/Swift-AI

使用NeuralNet-MNIST模型进行文本识别。

which uses NeuralNet-MNIST model for text recognition.

TODO:VNTextObservation> SwiftOCR

一旦我将其连接到另一个,就会使用VNTextObservation发布它的示例。

Will post example of it using VNTextObservation once I have it one connected to the other.

OpenCV + Tesseract OCR

我尝试使用OpenCV + Tesseract但是编译错误然后找到SwiftOCR。

I tried to use OpenCV + Tesseract but got compile errors then found SwiftOCR.

另请参阅:谷歌视觉iOS

注意谷歌视觉文字识别 - Android sdk有文本检测,但也有iOS co coapod。所以请密切关注它,因为最终应该向iOS添加文本识别。

Note Google Vision Text Recognition - Android sdk has text detection but also has iOS cocoapod. So keep an eye on it as should add text recognition to the iOS eventually.

https://developers.google.com/vision/text-overview

//更正:刚试过但是只有Android版本的sdk支持文本检测。

//Correction: just tried it but only Android version of the sdk supports text detection.

https://developers.google.com/vision/text-overview

如果您订阅了版本:
https://libraries.io/cocoapods/GoogleMobileVision

点击订阅发布
你可以看到TextDetection被添加到Cocoapod的iOS部分

Click SUBSCRIBE TO RELEASES you can see when TextDetection is added to the iOS part of the Cocoapod

这篇关于将Vision VNTextObservation转换为String的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆