SLIC_new_cityscapes_training_server_1.py 文件源码

python
阅读 45 收藏 0 点赞 0 评论 0

项目:SLIC_cityscapes 作者: wpqmanu 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号