I have been given a segmentation mask: a HxW numpy array in which each location represents a pixel. The value at each location is not RGB, however; it is an arbitrary integer in the range 0-60, where the integer is simply a code representing a type of image content.
E.g. array locations whose value is 12 indicate pixels categorized as 'table'; locations whose value is 34 indicate pixels categorized as 'carpet'.
I want to load this segmentation mask into a canvas using tkinter
, so I need to make an image out of it, and I need each of the values 0-60 to correspond to colors whose hues are as distinct as can be.
How do I choose these colors? How do I convert my HxW array into an RGB image?