我正在开发一款应用程序,其中显示了来自QR码的检测数据,但问题在于未检测到QR码。我已经使用此代码:CIDetector未检测到QR图像
NSDictionary *detectorOptions = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh };
CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:detectorOptions];
NSArray *features = [faceDetector featuresInImage:chosenImage.CIImage];
CIQRCodeFeature *faceFeature;
for(faceFeature in features)
{
qrcodedetected = YES;
self.decodedstr = [NSString stringWithFormat:@"%@",faceFeature.messageString];
break;
}
我已经搜索了很多,但没有成功。我使用了Apple默认窗体中的这些代码。每次我都会得到零结果。如果有人对此有任何解决方案,请与我分享。这将不胜感激。提前致谢。
为什么你不使用AVCaptureDevice.defaultDevice和AVCaptureSession读取QR码? – ObranS
@ObranS:我不知道该怎么做。你有这方面的任何代码吗?谢谢你的努力。 – Vishal
在下面添加,希望它能帮助你 – ObranS