Color Quantization

Is there any method in OpenMV for color quantization of an image, such as k-means clustering or other methods?

Uh, use the mode() filter with a very large window. It will produce cartoonish images except for the borders between objects with high-frequency noise.

If you apply an edge softening filter before using mode() you’ll likely get better results. E.g. try a large mean() filter and then mode() after.

I need to segment a grayscale image into 3 clusters. I will attempt the methods you suggested. Thanks!

You don’t need the mean() part for grayscale images because the color channels won’t diverge on the edges. mode() should do a very good job of flattening the colors in the image.