The following code is a Python program that can be run at the command line ,It takes input image and output name from user :
◾Convert bgr color to gray
◾Using GaussianBlur for decrease noises
◾Adaptive threshold to obtain binary image
◾Find contours and filter for largest contour
◾Find shape with 4 points by approxPolyDP
◾Draw contours around the sudoku table
◾Crop the table and save it as a jpg image
This python project has an ability to recognize Sudoku table in live webcam.
By pressing the s button, the sudoku image is cropped and saved.