twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
987 stars 272 forks source link

QR Code Rate of recognition AVCamBarcode vs. CodeScanner #124

Closed ralfebert closed 4 months ago

ralfebert commented 5 months ago

The Apple example project AVCamBarcode (https://developer.apple.com/documentation/avfoundation/capture_setup/avcambarcode_detecting_barcodes_and_faces) seems to do a few tricks to improve recognition of QR codes and seems to recognize small codes significantly better than CodeScanner.

A starting point could be the CameraViewController#setRecommendedZoomFactor method in the example project. But I am not sure if this is what makes the difference / there might be something else that improves the rate of recognition here – the example project doesn't use CIDetector at all.

Unfortunately I have no more time to investigate this further, the solution for my client will probably be "print bigger QR codes", just wanted to document our findings here.

karolbielski commented 4 months ago

I opened PR https://github.com/twostraws/CodeScanner/pull/127 that applies zoom factor and chooses wide angle camera if possible.