Ask Your Question

Revision history [back]

Hello, I would like to segment some images based on some conditions, Could you help me with that?

Hello I have an image that i got after performing clustering for 5 colors. Now there are only 5 colors present in the image. Suppose the colors are (100, 150, 200), (200, 250, 100), (50, 150, 200), (100, 250, 100), (0, 100, 200).

Now I want to split the image into chunks. Each chunks will have some percentage of the pixels of all the 5 colors. Say 20% pixels are of color A and 30% pixels are of color B and so on.

How do I split the image this way?

Example: This is the input image: input

This should be the output image: output

Each chunk has to have all the clustering colors (i.e. 5 if we use the example above) colors present in the image in it.