I'm trying to get 5 main/dominant colors from a CVPixelBuffer, and I need it to be as quick and efficient as possible.
I've tried Pixelating with CIFilter & Resize it, and only than go through the Pixels Data, but it's still pretty slow.
Also, how should I manage the tasks flow regarding to Threads Managing?
Any tips on working with CVPixelBuffer will be Great!
This is a K-Means problem and Core Image provides just the filter to solve it! The following code creates a 5x1
CGImageof the five dominant colors in theCIImage: