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
评论列表
文章目录