'how to normalize image python

hello everyone i want to normalize the Ieq image to have the same maximum and minimum grey levels as the original image.

img = cv2.imread("0ad7f631dedb.png")
img = cv2.resize(img,(299, 299))
green_channel = img[:,:,1]
median = cv2.medianBlur(green_channel,3)
clahe = cv2.createCLAHE(clipLimit=6.0, tileGridSize=(5,5))
cl1 = clahe.apply(median)
# Gaussian blurred gray image
gauss = cv2.GaussianBlur(cl1,(5,5),0)
cv2.imshow('gauss',gauss)
# apply median filter to gauss image
median2 = ndimage.median_filter(mean, size=78)
Ieq = cv2.subtract(median2,mean)
cv2.imshow("step2", Ieq)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source