remirobert/CameraEngine

Cant get barcode detection to wok

Opened this issue · 1 comments

Using the example provided, ive added the following lines to viewDidLoad()

        self.cameraEngine.metadataDetection = .barcode
        
        self.cameraEngine.blockCompletionCodeDetection = { codeObject in
            print(codeObject.stringValue)
            let valueCode = codeObject.stringValue
            let frameCode = (codeObject as AVMetadataObject).bounds
            print(frameCode)
//            self.displayLayerDetection(frame: frameCode)
        }

and am unable to detect ean13 codes. is there something else i need to do?

after a few hours of tinkering, i've figured out the problem...

inside CameraEngineMetadataOutput.swift the method

func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [AnyObject]!, from connection: AVCaptureConnection!)

was replaced with

func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection)