I am trying to build a PDF417 code reader. I used the following tutorial and my code is working. http://www.appcoda.com/qr-code-reader-swift/ Scrolling at the bottom of the page you can also find the source code.
I am using AVFoundation and setting captureMetaDataOutput.metadataObjectTypes
to AVMetadataObjectTypePDF417Code
All I want to know is if there is a way to optimize reading a PDF417 code using AVFoundation? Currently the scanning takes lot of time to detect, even sometime i need to tilt the phone to make sure both are in parallel to work and some code never works though its pdf417. I have already set the following as suggested by apple doc here (https://developer.apple.com/library/ios/technotes/tn2325/_index.html) and I can see some improvement but its still very slow and most of the time it fails.
do {
try captureDevice!.lockForConfiguration()
captureDevice?.videoZoomFactor = zoomFactor!
captureDevice!.unlockForConfiguration()
} catch {
print(error)
}
I am trying to read some boarding passes here. Anything else which can improve this scanning.
Please let me know if you have any suggestion.
Update: Here is a sample barcode which will never work with this code but if you use a app like https://goo.gl/EBk7Pu it can detect even when you show just partial barcodes.
TIA