Fix frame orientation using Google Mobile Vision

316 Views Asked by At

I'm using Google Mobile Vision to process camera frames and detect faces. After detecting a face I want to save the frame to a file but it has a wrong orientation.

func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) {
    guard let image = GMVUtility.sampleBufferTo32RGBA(sampleBuffer) else {
        print("No Image")
        return
    }

    // wrong orientation when saving image here
}
0

There are 0 best solutions below