Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Cant get barcode detection to wok #84

Open
multinerd opened this issue Sep 15, 2017 · 1 comment
Open

Cant get barcode detection to wok #84

multinerd opened this issue Sep 15, 2017 · 1 comment

Comments

@multinerd
Copy link

multinerd commented Sep 15, 2017

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?

@multinerd
Copy link
Author

multinerd commented Sep 15, 2017

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant