What it does

You use your phone to take a picture of each side of a Rubik's cube. Each image is then processed to find the colors on each side, then run through a Ruibk's cube solver. The solution is then rendered and shown in 3d to the user.

How we built it

The webpage simply uploads pictures and routes them to an S3 bucket on amazon web services. On there, a lambda function is called every time an image is added that does the image processing.

The image processing is done in python using OpenCV. We use edge detection to find the cube face, subdivide the face into 9 segments, then find the average color of each segment. Later, when all 6 faces are collected, we construct a Rubik's cube using this information.

The solution is then found using the Kociemba library in python, still calculated in the S3 bucket. This solution is then posted to a url where it is read by the webpage and rendered by three.js.

Challenges we ran into

Using AWS services correctly took a long time. Also, processing the image while taking into account issues like different shot angles, glare, and shadows took a lot of work.

Accomplishments that we're proud of

The image is processing is surprisingly consistent despite having to deal with very close colors such as red and orange.

What we learned

We learned how to use the OpenCV library, how to use S3 buckets, and how to interface between a webpage and S3 buckets.

Share this project: