Solving Sudoku with Computer Vision

I decided today that it was time to get some mental exercise, and that I wanted to create a program that could take a picture of a Sudoku puzzle, and then solve it. A quick Google search will reveal that this idea is pretty far from being novel. I'm not the first person to do this, and I surely will not be the last. Nonetheless, I think working through the problem was an enjoyable experience, and a nice way to stretch my problem-solving skills. So let's just hop into how I did it. First, I wanted to preprocess the image. The first step in reading the digits from the board is to actually find where the board is in the image. There are tools we have at our disposal for doing that, but none of them will perform well on an image like this. Instead, we should binarize the image, and clean it up as best we can. #-- Preprocess the image so that it is a clean black and white image #-- that the puzzle can be extracted from def preprocessImage(img, visualize=False): #-- Cnvert the ...