How to deal with images of texture and varied lighting dynamically

i’m trying to extract the board in this image


but need to do the same for multiple images with different board positions and lighting, can someone recommend an approach suitable for these type of images as it has texture and boundary isn’t very distinguished

crosspost: python - How to get external boundary/corners of chess board? - Stack Overflow