jjzjj

videoDisplayView

全部标签

ios - 如何使用 CAShapeLayer 和 UIBezierPath 在实时摄像头源上绘制检测到的矩形路径

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