def resultimg(self, centers):
print "show result"
result = scipy.zeros(self.img.shape[:2], scipy.uint8)
width, height = result.shape[:2]
if len(result.shape)>2:
color_channels=result.shape[2]
else:
color_channels=1
colors = [scipy.array([int(random.uniform(0, 255)) for i in xrange(1)]) for j in xrange(len(centers))]
for x in xrange(width):
for y in xrange(height):
result[x, y] = colors[self.assignedindex[x][y]]
# cv2.imshow("result", result)
# cv2.waitKey(10)
cv2.imwrite(os.path.join(self.result_dir,self.filename+'_superpixel.png'), result)
SLIC_new_cityscapes_training_server_1.py 文件源码
python
阅读 45
收藏 0
点赞 0
评论 0
评论列表
文章目录