由于执行期间发生错误,命令缓冲区的执行被中止。丢弃(GPU错误/恢复的受害者)(IOAF代码5)

时间:2019-03-30 10:23:42

标签: ios swift ipad ios-camera cidetector

我们正在使用CIRectFeature通过摄像机委托(AVCaptureVideoDataOutputSampleBufferDelegate)检测矩形区域,并且可以与iPad Pro第三代以外的其他设备正常工作。由于CIRectangleFeature应用程序每次都挂起并在错误以下返回的原因

  

由于执行期间发生错误,命令缓冲区的执行被中止   执行。丢弃(GPU错误/恢复的受害者)(IOAF代码5)

fileprivate let rectangleDetector = CIDetector(ofType: CIDetectorTypeRectangle, context: nil, options: [CIDetectorAccuracy:CIDetectorAccuracyHigh])

func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection)
{


        guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else {
            return
        }
        let videoOutputImage = CIImage.init(cvPixelBuffer: pixelBuffer)


        guard let rectangeFeatures = self.rectangleDetector?.features(in: videoOutputImage) as? [CIRectangleFeature] else {
            return
        }

}

0 个答案:

没有答案