def adjust_brightness(image, brightness):
if (brightness < 0):
brightness = 0
elif (brightness > 200):
brightness = 200
brightness = (((brightness) * (510)) / 200) - 255
img = image.astype(np.float) + brightness
img[img > 255] = 255
img[img < 0] = 0
return img.astype(np.ubyte)
评论列表
文章目录