0
我正在开发一个应用程序,我必须从静止图像中读取QR码。下面是我用来读取QR代码的代码:从静止图像中读取QR码
CIImage *ciimage = [CIImage imageWithCGImage:[getRotatedImage CGImage]];
NSDictionary *detectorOptions = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh };
CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:detectorOptions];
NSArray *features = [faceDetector featuresInImage:ciimage];
CIQRCodeFeature *faceFeature;
for(faceFeature in features)
{
NSString *str = [NSString stringWithFormat:@"%@",faceFeature.messageString];
break;
}
此代码工作正常一些QR码,但一段时间后它不与静止图像的工作并返回空数组。我搜索了很多,也看到苹果论坛他们也描述了我用过的相同的代码。我还附加了未解码的图像。 请任何机构有关于此的任何类型的信息,然后与我分享。这将非常感激。提前致谢。
是QR码的位置始终在左下角? –
不@YUNCHEN:不是必须的,它可能在左上角,右上角等。谢谢! – Vishal