/* Return a RGB colour value given a scalar v in the range [vmin,vmax] In this case each colour component ranges from 0 (no contribution) to 1 (fully saturated), modifications for other ranges is trivial. The colour is clipped at the end of the scale…
图片中存在着色版的概念,二维矩阵的每个元素的值指定了一种颜色,因此可以显示出彩色. 迁移调色板 下述python代码将VOC数据集中的某个语义分割的图片的调色板直接应用在一个二维矩阵代表的图像上 #label_im is a numpy array of 1 x height x width #return an Image object,call its' save('out.png') functioin to save as image file def palette( label_im…