def change_brightness(img, alpha, beta):
return cv2.addWeighted(img, alpha, np.zeros(img.shape, img.dtype),0, beta)
Here alpha & beta are input parameters. Each pixel of the input image will change according to this formula.
alpha(pixel_value) + beta.
Lower value of alpha like 2 or 3 is good