I have an image where i have objects labeled with numbers e.g all the pixels belong to object 1 has the value 1 and so on. Rest of the image is zero.
I want to see every object in different random colors with white background.
I have tried several color maps like gray,jet etc but none of them meet the requirement because they sequentially color the objects from dark to light.
Thanks a lot.
Make your own colormap with random colors is a quick way to solve this problem:
First color is white, to give you the white background.
Full code in action:
Sample labelled, randomly colored output:
Hope thats random enuff for ya!