How rg1990/cv-sudoku-solver works
Project type and purpose
• This is a Python project that combines a computer‐vision + deep‐learning pipeline for extracting and solving Sudoku puzzles from images, along with a Pygame‐based interactive Sudoku game.
• Key use cases:
• Train or load a CNN model to classify digits.
• Process an image of a Sudoku grid (OpenCV) → recognize digits (Keras model) → solve (backtracking).
• Render solution back onto original image or present as an interactive game (Pygame).
File structure
• Top‐level scripts:
• prepare_data.py → builds the font + MNIST datasets.
• train.py → trains a Keras CNN, outputs to /models.
• sudoku_main.py → CLI for processing a Sudoku image end‐to‐end.
• sudoku_game.py → launches the Pygame UI for preloaded puzzles or drag/drop images.
• sudoku_solver_class.py → the backtracking solver core.
• sudoku_utils.py → shared utilities (image transforms, grid extraction, digit bounding).
• Data directories:
• data/digit_images & data/font_exclude → font‐based digit images.
• data/sudoku_images → raw input images.
• data/sudoku_puzzles → text‐based puzzles for game mode.
• Models directory: saved .keras model files.
• Config & deps: requirements.txt, .gitignore.
README for additional insights
• Confirms two pipelines:
A. CV + DL → solve + overlay solution.
B. Pygame UI → choose from text puzzles or drag/drop image → hint, check, solve.
• Libraries: OpenCV, Keras, Pygame.