Hola soy nueva básicamente usando Python y estoy haciendo un programa interactivo para cambiar el contraste de una imagen pero me sale un error sobre la falta de un argumento cuando ingreso el parámetro d que es el de controlador slider
def plot_image(image,title=''):
plt.title(title, size=20)
plt.imshow(image)
plt.axis('off')
def contrast(c, d):
return 0 if c<70 else (255 if c>150 else cont(255*c-22950)/d)
def contraste (d):
im8_r,im8_g,im8_b,_ = im8.split()
im_t3 = im8.point(contrast)
im8_r,im8_g,im8_b,_ = im_t3.split()
plot_image(im_t3,'imagen transformada')
widgets.interact(contraste, d=widgets.IntSlider(value=7,
min=0,
max=10,
step=1,
description='Contraste:',
disabled=False,
continuous_update=False,
orientation='horizontal',
readout=True,
readout_format='d'));
y me sale este error
return self._new(self.im.point_transform(scale, offset))
1576 # for other modes, convert the function to a table
-> 1577 lut = [lut(i) for i in range(256)] * self.im.bands
1578
1579 if self.mode == "F":
TypeError: contrast() missing 1 required positional argument: 'd'