MLKitTextRecognitionCommon 框架参考
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TextRecognizer
class TextRecognizer : NSObject
一种文本识别器,用于识别图片中的文本。
-
返回采用指定选项的文本识别器。
以不同语言并发使用多个 TextRecognizer
实例
选项,因为这可能会导致性能下降。
声明
Swift
class func textRecognizer(options: MLKCommonTextRecognizerOptions) -> Self
-
-
返回给定图片中的文本识别结果,如果出现错误,则返回 nil
。文字
识别操作会在发起调用的线程上同步执行。
建议在主线程之外调用此方法,以避免阻塞界面。作为
结果,如果在主线程上调用此方法,则会引发 NSException
。
返回值
给定图片中的文本识别结果;如果出现错误,则返回 nil
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-08-22。"],[[["`TextRecognizer` identifies and extracts text within images."],["It offers both synchronous and asynchronous processing options."],["Concurrent use with varying language settings may impact performance."],["Direct use on the main thread is discouraged due to potential UI blocking."]]],["The `TextRecognizer` class recognizes text in images. It can be initialized with specific options via `textRecognizer(options:)`. The `process(_:)` method performs text recognition on an image asynchronously, while `results(in:)` performs it synchronously, returning the recognized text or `nil` if an error occurs. Concurrent usage of multiple `TextRecognizer` instances with different language options may reduce performance. `results(in:)` should not be called on the main thread.\n"]]