【发布时间】:2015-10-13 09:51:35
【问题描述】:
当我尝试使用CIDetector读取iPhone或iPod上的二维码时,检测器总是返回nil:
NSDictionary *detectorOptions = @{@"CIDetectorAccuracy": @"CIDetectorAccuracyHigh"};
CIDetector * detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:detectorOptions];
在 iPad 上运行此代码有效。 所有设备都在 iOS 9 上,使用 Xcode 7.0.1
其他检测器工作正常,比如人脸检测成功:
detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions];
是否有额外的设置/库让 QRCode 检测器在 iPhone / iPod 上工作?
【问题讨论】:
-
设备到底是什么?您扫描的是完全相同的图像吗?例如,如果它来自相机,则相机可能太差而无法扫描小 QRCode,并且每个设备都不同。
-
我的问题不是检测器在图像中找不到二维码;问题是 CIDetector 甚至没有在我的物理 iPhone 5 和第 5 代 iPod 上实例化,只在我的 iPad Air 2 上实例化。我添加了确切的硬件版本,因为这可能是与 GPU 相关的问题?
-
我也面临同样的问题,我用 ipad 和 iphone 都试过了,我无法在 CIDetectorTypeQRCode 模式下实例化 CIDetector。
-
在 iPad 中检测二维码时,我得到 CIDetector nil。让我知道正确的解决方案。
标签: ios objective-c iphone ipad cidetector