How johntton/rubiksolver works
Rubik’s Cube Vision Solver captures six cube faces, extracts sticker regions, classifies their colors, converts the reconstructed state into Kociemba facelet notation, and computes a move sequence. The main program orchestrates the workflow and prints the result. The sampled code confirms camera/scanning, LAB k-means classification, and the native two-phase solver; CubeSolver implementation details are not sampled, so its internal native-call wiring is shown only at the documented integration boundary.
Components 16
Capture Workflow
- Application Orchestrator
src/main.cpp - Cube Scanner
src/CubeScanner.cpp - Six Face Images
include/CubeScanner.h
Vision Processing
- Color Detector
src/ColorDetector.cpp - LAB K-Means
src/ColorDetector.cpp
Cube Solving
- Cube State Conversion
src/CubeSolver.cpp - Solver Interface
include/CubeSolver.h - Move Sequence
src/main.cpp
Kociemba Engine
- Two-Phase Search
kociemba/search.c - Cubie Model
kociemba/cubiecube.c - Coordinate Tables
kociemba/coordcube.c - Pruning Tables
kociemba/coordcube.c - Native Solver API
kociemba/solve.c
Other components
- Operator
- Camera
- OpenCV
Connections 22
- Operator → Application Orchestrator: starts scan
- Camera → Cube Scanner: supplies frames
- Application Orchestrator → Cube Scanner: captures frames
- Cube Scanner → OpenCV: uses capture
- Application Orchestrator → Cube Scanner: draws grid
- Application Orchestrator → Cube Scanner: extracts ROIs
- Cube Scanner → Six Face Images: stores faces
- Application Orchestrator → Six Face Images: reads faces
- Application Orchestrator → Color Detector: trains colors
- Color Detector → OpenCV: processes images
- Color Detector → LAB K-Means: clusters LAB
- Application Orchestrator → Color Detector: classifies stickers
- Application Orchestrator → Cube State Conversion: passes labels
- Application Orchestrator → Solver Interface: requests conversion
- Solver Interface → Native Solver API: calls solver
- Native Solver API → Two-Phase Search: dispatches search
- Two-Phase Search → Cubie Model: converts cubies
- Two-Phase Search → Coordinate Tables: uses coordinates
- Coordinate Tables → Pruning Tables: reads heuristics
- Coordinate Tables → Cubie Model: builds moves
- Two-Phase Search → Solver Interface: returns moves
- Application Orchestrator → Move Sequence: prints solution