So I try to enhance this image by applying log transform on it original image The area where there are bright white color turns into color blue on the enhanced image. enhanced image
path = '...JPG'
image = cv2.imread(path)
c = 255 / np.log(1 + np.max(image))
log_image = c * (np.log(image + 1))
# Specify the data type so that
# float value will be converted to int
log_image = np.array(log_image, dtype = np.uint8)
cv2.imwrite('img.JPG', log_image)
There's also a warning: RuntimeWarning: divide by zero encountered in log
I tried using other type of log (e.g log2, log10...) but it still show the same result. I tried changing dtype = np.uint32 but it causes error.