Last active
December 17, 2015 10:49
-
-
Save odebeir/5598052 to your computer and use it in GitHub Desktop.
label2rgb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
label = np.asarray([[0,1],[2,3]]) | |
rgblabel = np.zeros([2,2,3]) | |
rgblabel[label==1,:]=[1,0,0] | |
rgblabel[label==2,:]=[0,1,0] | |
rgblabel[label==3,:]=[0,0,1] | |
plt.imshow(rgblabel,interpolation='nearest') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment