https://github.com/tentone/rubix-solver
Rubix cube detector and solver using computer vision.
https://github.com/tentone/rubix-solver
opencv rubix-cube
Last synced: 2 months ago
JSON representation
Rubix cube detector and solver using computer vision.
- Host: GitHub
- URL: https://github.com/tentone/rubix-solver
- Owner: tentone
- Created: 2022-09-01T17:26:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T21:36:15.000Z (over 3 years ago)
- Last Synced: 2025-04-05T03:42:42.661Z (about 1 year ago)
- Topics: opencv, rubix-cube
- Language: C++
- Homepage:
- Size: 29.3 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rubix Solver
- Rubix cube solver using computer vision.
- Identifies the state of your rubix cube and helps you to solve it.
- Step by step instructions to solve the rubix cube.

## Setup
- Install dependencies from the `install.sh` file.
- Install [OpenCV](https://github.com/opencv/opencv) from github (pre-built binary or from souce).
- Can use the `install-opencv.sh` script available on the repository
- Run the code using cmake or the `run.sh` script.
## Vision Algorihtm
- The vision algorithm is quite simple and is composed of three main steps.
- We look for clusters of quads that compose the face of the cube.
- Each quad is tested for color using HSL filtering.
- Finally the quads are sorted based on the position.
- The faces are identified by their center color.

## Solve Algorithm
- The original 3x3x3 Rubik's cube has 43.252.003.274.489.856.000 possible combinations.
- Theoritically a rubik's cube can be solved in 20 moved from any position.
- The algorithm implemented to solve the rubix cube in the system uses a brute-force approach.
- Some optimizations are performed to remove ambigous movements.
- The depth of moves is limited by performance of the algorithm.
- The max depth of moves can be changed in the GUI. By default 10 is used.
- An alternative algorithms such as the [Thisletwaite's algorithm](https://github.com/conanwu777/rubik) could be used instead.
- The cube movements use the notation presented in the picture bellow.

## License
- This project is distributed under MIT license available on the repository page.