I try to make some histogram calculations using vImage buffers in Accelerate framework and I supply camera image as UIimage converted from CVpixelbuffer. Algorithm works with no error however processed camera image data on the screen is very slow. I read some info in Apple documentation about freeing the buffers when task is completed. I wrote two lines of code after grab the buffer data. However nothing changes. Please see attached screenshot of buffers data after they are freed.SourceBuffer and histogramSourceBuffer are seems not freed. I don't know how a free buffer has to be seen in debugger but mine are shown with height, width and data info. Any recommendation how to free the buffer and how can I ensure it is freed. Many thanks indeed
if let finalImage = try? sourceBuffer.createCGImage(format: format) {
sourceBuffer.free()
histogramSourceBuffer.free()
return UIImage(cgImage: finalImage)