utilities.py 文件源码

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

项目:livespin 作者: biocompibens 项目源码 文件源码
def convert16to8(self, smooth = False):
        if smooth:
            matout = self.smooth
        else:
            matout = self.image
        p = np.percentile(matout, 98)
        lowp = np.percentile(matout, 1)
        matout -= lowp
        if p == 0:
            p = np.max(matout)
        #print lowp, p, np.max(matout)
        matout[matout < 0] = 0
        matout[matout > p] = p
        #pylab.imshow(matout/p*255, 'gray')
        #pylab.show()
        return np.array(matout/p*255, np.uint8)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号