title: capture UIImage from CMSampleBuffer (swift 3)
body: <p>I try to capture an UIImage from a CMSampleBuffer to read the text. But I always get the error:</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>I was looking around and tried a lot of versions. But I always get the same error.</p>
  
  <pre><code>func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) {
  
          let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
          let image = CIImage(cvPixelBuffer: pixelBuffer!)
              let uiImage = UIImage(cgImage: image.cgImage!)
  }
  </code></pre>
  
  <p>kindly Regards!</p>