- Make CVPixel Buffer.
var pixelBuffer: CVPixelBuffer?
let attrs = [kCVPixelBufferCGImageCompatibilityKey: kCFBooleanTrue,
kCVPixelBufferCGBitmapContextCompatibilityKey: kCFBooleanTrue] as CFDictionarylet width:Int = Int(size.width)let height:Int = Int(size.height)CVPixelBufferCreate(kCFAllocatorDefault,
width,
height,
kCVPixelFormatType_32BGRA,
attrs,
&pixelBuffer)
2, Render CIImage to CVPixelBuffer.
let context = CIContext()
context.render(ciImage, to: pixelBuffer!)
****
We send information related to machine learning.
contact:
rockyshikoku@gmail.com