This is my image
I found this Matlab How to remove the glare and brightness in an image (Image preprocessing)?
I replicate it.
m_img = cv2.medianBlur(img,5)
ret,th1 = cv2.threshold(m_img,180,255,cv2.THRESH_BINARY)
timg = cv2.inpaint(cimg,th1,9,cv2.INPAINT_NS)
thresholded image
This is my result
Not an exact improvement like I even lose the grids.
I even went through this How to remove glare from image
But I can't find any polarizer filter implementation in image processing.
Can anyone suggestion any improvements so that I can lose the glare without losing the grid?