Question about QRCodeRecognize
HIIgor opened this issue · comments
igor xiang commented
你好,最近在做识别二维码的功能,看到EFQRCode识别这块的逻辑有2个疑问.
为什么 CIDetectorAccuracyLow 低精度的识别要放到高精度的后面呢,我理解低精度的速度较快,高精度应该做兜底.
另外一个疑问是 取得图片的灰度这块是必须的吗
private func getQRString() -> [String] {
let result = image.ciImage().recognizeQRCode(
options: [CIDetectorAccuracy: CIDetectorAccuracyHigh]
)
if result.isEmpty, let grayscaleImage = image.grayscale {
return grayscaleImage.ciImage().recognizeQRCode(
options: [CIDetectorAccuracy: CIDetectorAccuracyLow]
)
}
return result
}
珲少 commented
me too...