1

I can scan Code 39 barcodes but scanning a vin barcode (which is a subset of Code 39) doesn't work. Does anyone know if it's possible to scan a VIN barcode using VNDetectBarcodesRequest.

func processClassification(_ request: VNRequest) {
    guard let barcodes = request.results else { return }
    DispatchQueue.main.async { [self] in
      if captureSession.isRunning {
        view.layer.sublayers?.removeSubrange(1...)

        for barcode in barcodes {
          guard
            let potentialVINCode = barcode as? VNBarcodeObservation,
            potentialVINCode.symbology == .code39
            
            else { return }

          observationHandler(payload: potentialVINCode.payloadStringValue)
        }
      }
    }
  }
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
zer0day
  • 236
  • 1
  • 3
  • 11

0 Answers0