I am trying to use swift and a simple AVCaptureSession along with google's MLKit Barcode Detector to detect PDF417 barcodes. However, it does not detect truncated PDF417 barcodes without the end lines. Is there any swift library that can add this onto the end of the barcode by appending an image layer? I currently also have the corners of the barcode:
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
let barcodeScanner = BarcodeScanner.barcodeScanner(options: barcodeOptions)
// print("Capturing", Date())
let image = VisionImage(buffer: sampleBuffer)
image.orientation = imageOrientation(
deviceOrientation: UIDevice.current.orientation,
cameraPosition: AVCaptureDevice.Position.front)
guard let barcodes = try? barcodeScanner.results(in: image) else {return}
for barcode in barcodes {
let corners = barcode.cornerPoints
print(corners)
//let displayValue = barcode.displayValue
let rawValue = barcode.rawValue
Truncated:
Non-Truncated