我还在Apple Dev Forum 上找到了这个问题。
一CIDetector
组 with是否CIDetectorTypeRectangle
可以返回多个矩形?
目前,此代码总是返回一个feature.count
or 0
,1
即使图片中充满了矩形。
let context = CIContext()
let opts = [CIDetectorAccuracy : CIDetectorAccuracyHigh]
let detector = CIDetector(ofType: CIDetectorTypeRectangle, context: context, options: opts)
let image = CIImage(image: self.photoTaken)
let features = detector.features(in: image)
print(features.count) // never more than 1