EFQRCode icon indicating copy to clipboard operation
EFQRCode copied to clipboard

Question about QRCodeRecognize

Open HIIgor opened this issue 3 years ago • 1 comments

你好,最近在做识别二维码的功能,看到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
}

HIIgor avatar Aug 11 '22 02:08 HIIgor

me too...

ZYHshao avatar Apr 08 '24 08:04 ZYHshao