0

我在检测图像上的 Aztec 代码时遇到问题。首先,我尝试使用 QR 码,它没有问题,我将 UIImage 转换为 CIImage,然后检测功能。使用 QR 码它检测到一切正常,但使用 Aztec 码,它根本不起作用,在苹果文档中,它说它应该读取所​​有 2D 条形码。

这是我的代码:

func detectData(ciImage: CIImage) -> String {
       let detector: CIDetector=CIDetector(ofType: CIDetectorTypeQRCode, context: nil, options: [CIDetectorAccuracy: CIDetectorAccuracyHigh])!

       var qrCodeLink=""

       let features=detector.features(in: ciImage)

       for feature in features as! [CIQRCodeFeature] {
           qrCodeLink += feature.messageString!
       }

       if qrCodeLink=="" {
           return "nothing"
       } else {
          return "message: \(qrCodeLink)"
       }
   }
4

1 回答 1

0

我想说,使用内置软件框架无法检测到阿兹台克代码。在链接的文档中,它说“二维码是使用 ISO/IEC 18004:2006 标准的二维条码。”,但是维基百科指出“阿兹台克代码也作为 ISO/IEC 24778:2008 标准发布”。所以我猜它只是不支持(还)。

于 2021-02-03T09:53:04.790 回答