I am trying to identify squares on a chess Board and assign them them a ID which will be their square numbers like a1, a2, h1, ...h8. I applied contour detection on the image of the chess Board with some pre-editing like first converting the to grayscale, then canny edge detection along with houghlines. This is the result that I got. Image with contours detected.
I successfully got the required 64 contours but I am not able to assign them their respective IDs like this : Chess Squares Notations I tried iterating through the contours but they were differently arranged every time.
How do I assign IDs(which are basically chess square notations) to the 64 contours ?