I use Swift to process the video. After upgrading to El Capitan (and Swift 2), my code broke. I traced the error to the CIFilter CIColorClamp function. This feature is supposed to pinch pixel values, but actually spoil the image volume.
let _c:CGFloat = 0.05
let minComp = CIVector(x:_c, y:_c, z:_c, w: 1)
let maxComp = CIVector(x:1, y:1, z:1, w: 1)
let clamp: CIFilter = CIFilter(name: "CIColorClamp")!
print("clamp-in \(image.extent)")
clamp.setDefaults()
clamp.setValue(image, forKey: kCIInputImageKey)
clamp.setValue(minComp, forKey: "inputMinComponents")
clamp.setValue(maxComp, forKey: "inputMaxComponents")
print("clamp-out \(clamp.outputImage!.extent)")
The above code displays the result:
> clamp-in (6.0, 6.0, 1268.0, 708.0)
CoreAnimation: Warning! CAImageQueueSetOwner() is deprecated and does nothing. Please stop calling this method.
> clamp-out (-8.98846567431158e+307, -8.98846567431158e+307, 1.79769313486232e+308, 1.79769313486232e+308)
The fact that this call causes an internal warning also does not give confidence!
Can anyone confirm this behavior? What am I doing wrong?
source
share