let us consider following code -which reads image, applies histogram equalization procedure and display both result :
import cv2
import numpy as np
img = cv2.imread('original.png', cv2.IMREAD_GRAYSCALE)
assert img is not None, "file could not be read, check with os.path.exists()"
equ = cv2.equalizeHist(img)
res = np.hstack((img,equ)) #stacking images side-by-side
cv2.imshow("both image",res)
cv2.waitKey(0)
cv2.destroyAllWindows()
we can see clearly that contrast of the image was increased, but as you know almost every part of the AI , Machine learning or computer vision tasks is evaluated by some criteria, for example in deep learning we have notion of loss function(like a binary_crossentropy, mean_squared_error and etc), so my question is : is there any measurment scale whch will be suitable to the contrast increasment ? so if i would like to ask : by how much or how large changement has been made after histogram equalization, is there any score for this? sure i can calculate difference between two image as they have same dimension and calculate square of difference(therefore squared distance between two image) but is it correct? maybe difference between two histogram(difference between two distribution) will be right action to be done?if so could you tell me please how?