我正在开发一个应用程序来检测实时摄像头画面中的矩形并突出显示检测到的矩形。我使用AVFoundation做了相机的事情,并使用了下面的方法来检测和突出显示检测到的矩形。vardetector:CIDetector?;overridefuncviewDidLoad(){super.viewDidLoad();detector=self.prepareRectangleDetector();}funccaptureOutput(captureOutput:AVCaptureOutput!,didOutputSampleBuffersampleBuffer:CMSampleBuffer!,f