brightcons_plg.py 文件源码

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

项目:imagepy 作者: Image-Py 项目源码 文件源码
def load(self, ips):
        if ips.imgtype in ('8-bit', 'rgb'):
            self.para = {'bright':0, 'contrast':45}
            self.view = [('slide', (-100,100), 'Brightness', 'bright', ''),
                ('slide', (1,89), 'Contrast', 'contrast', '')]
            if 'not_slice' in self.note:
                self.note.remove('not_slice')
        else :
            self.arange = minv, maxv = ips.img.min(), ips.img.max()
            self.para = {'bright':np.mean(ips.range) - np.mean(self.arange), 
                'contrast':round(np.arctan((maxv-minv)/(ips.range[1]-ips.range[0]))/np.pi*180)}
            self.view = [('slide', (-(maxv-minv)/2, (maxv-minv)/2), 'Brightness', 'bright', ''),
                ('slide', (1,89), 'Contrast', 'contrast', '')]
            if not 'not_slice' in self.note:
                self.note.append('not_slice')
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号