1

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

KD.
  • 2,015
  • 3
  • 28
  • 59
  • what is your problem? takes too long, scans the wrong data, doesn't acquire the images? – Grady Player Oct 08 '15 at 03:39
  • Takes too long to scan and sometime doesn't even scans. Also sometime i really need to tilt the device to make it in parallel to the code to work. Updating the question. – KD. Oct 08 '15 at 03:40
  • 1
    @KD. did you fixed your problem? cause I have a similar problem, the scanner does not decode the whole information encode over the barcodes – Cristian Oct 01 '17 at 07:06

0 Answers0