0

I followed the guide, and while it works on Android just fine, on iOS all the coordinates for scanned barcodes are wrong.

I'm not going to paste my whole code as it is the same as one from the guide.

The issue seems to be connected with the orientation. The provided coordinates would work fine if we can rotate and flip them. Or in other words: the provided coordinates appear to be in .leftMirrored orientation, while I'm holding the phone .up.

I tried to manually set orientation on VisionImage or MLImage. But changing orientation to any value there doesn't change anything. Almost like setting orientation does nothing?

  let mlImage = MLImage(sampleBuffer: sampleBuffer)
  mlImage!.orientation = UIImage.Orientation.leftMirrored
      
      
//  let image = VisionImage(buffer: sampleBuffer)
//  image.orientation = UIImage.Orientation.rightMirrored

Any help is appreciated.

JoKr
  • 4,976
  • 8
  • 27
  • 39

0 Answers0