Reading on QRCodes on iOS with AVCaptureSession —

2019-07-23 18:22发布

We have implemented a QRCode reading function in iOS using the AVCaptureSession class, as described nicely here:

https://github.com/HEmobile/ScanBarCode/tree/master/ScanBarCodes https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureSession_Class/

But one thing we notice... the QRCode has to be aligned exactly vertically or horizontally. Oblique angles such as 45 degress does not trigger a scan. This issue doesn't really google, which is surprising.

Our experiments with other QRcode reading apps indicate that this limitation does not exist. Perhaps/seemingly (presumably -- since the built-in function is new) these apps don't use AVCaptureSession.

Our question is, is this a sign that Apple's version of this function is not mature yet? Or is there some option to enable or improve this capability?

Thanks for any thoughts.

1条回答
趁早两清
2楼-- · 2019-07-23 19:09

It seems you've written some sort of limitation in your code. Check out my github repo: https://github.com/alexekoren/qr-3d

It was built specifically for reading QR Codes at angles in a pretty way. I'm testing it now and it pulls at 30-45 degrees easily.

Here's the direct link for everything you'll need to make the scanner object that can present on a UIView: https://github.com/AlexEKoren/QR-3D/blob/master/Code%20Scanner/Scanner/CSScanner.m

It should work out of the box!

查看更多
登录 后发表回答