1

CIRectFeatureカメラ デリゲート ( ) を使用して四角形領域を検出するために使用しており、第 3 世代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
        }

}
4

0 に答える 0