How to convert a Label matrix to colour matrix for image segmentation?
问题 I have a label matrix of 256*256 for example. And the classes are 0-11 so 12 classes. I want to convert the label matrix to colour matrix. I tried do it in a code like this `for i in range(256): for j in range(256): if x[i][j] == 11: dummy[i][j] = [255,255,255] if x[i][j] == 1: dummy[i][j] = [144,0,0] if x[i][j] == 2: dummy[i][j] = [0,255,0] if x[i][j] == 3: dummy[i][j] = [0,0,255] if x[i][j] == 4: dummy[i][j] = [144,255,0] if x[i][j] == 5: dummy[i][j] = [144,0,255] if x[i][j] == 6: dummy[i]