iphone - 使用 iphone 摄像头检测和识别数字

标签 iphone ios

是否可以让 iPhone 摄像头检测数字并将其转换为我可以在应用计算中使用的有效数字?

我确实看到了这个开源项目“Tesseract-iPhone-Demo-master”但是它没有正常工作。有什么提示可以帮助我实现这个想法吗?

最佳答案

Tesseract Library 只会为您提供图像上的文本。这个图书馆并不像你说的那么准确。 Tesseract 将为您提供 150 dpis 以上的高 dpi 图像的最佳结果。之后所有的号码验证都应该由你自己完成,比如: NSString *originalString = @"这是我的字符串。#1234";

NSString *numberString;
NSScanner *scanner = [NSScanner scannerWithString:yourString];
NSCharacterSet *numbers = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
[scanner scanCharactersFromSet:numbers intoString:&numberString];
int number = [numberString integerValue];

关于iphone - 使用 iphone 摄像头检测和识别数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14450293/

相关文章:

ios - UitextFiled 的首字母必须为 0,格式类似于 (0) 1234 56789

android - 我如何将 View 放入钛的 View 中

ios - UIWebview 禁用重定向到 AppStore

ios - Collection View - 从不同文件夹接收图像 - 如何?

iphone - 使用 hitTest :? 获取 UIView 上的最低 View

iphone - 应用程序加载器错误消息 (iPhone)

iphone - 应用内购买未在沙盒中销售

ios - NSJSON 序列化错误?

ios - NSPredicate 查询不包含特定字符串

ios - 无法使 UIButton 的图层蒙版起作用