Reading Rubik's Cube states into computer using Computer Vision magic

Great work!

Are you aiming for detecting 3-4 faces simultaneously in the future?
Using an orthographic projection to map out the faces on the side, and detect stickers even there is occlusion like our fingers on some sides.
Like in one webcam shot, about 9 stickers upfront + 6-7 stickers on the side may be detected, so that the cube needs just a y2 and the webcam will register the entire cube state.
 
Is there a way to analyze a photo previously taken instead of using the webcam?
Yes. In the function grab_colors in vision2.py you can substitute the code given between "def grab_colors():" and "bgrcap = cv2.blur(bgrcap, (5, 5))" in the original code by the lines given below if the image has the name test.jpg and is in the same directory as vision2.py.

Code:
def grab_colors():
    global cent, width, height, hsv, color_mask, white_mask

    bgrcap = cv2.imread('test.jpg')
    height, width = bgrcap.shape[:2]
    while 1:
        bgrcap = cv2.imread('test.jpg')
        bgrcap = cv2.blur(bgrcap, (5, 5))
[
 
Last edited:
Yes. In the function grab_colors in vision2.py you can substitute the code given between "def grab_colors():" and "bgrcap = cv2.blur(bgrcap, (5, 5))" in the original code by the lines given below if the image has the name test.jpg and is in the same directory as vision2.py.

Code:
def grab_colors():
    global cent, width, height, hsv, color_mask, white_mask

    bgrcap = cv2.imread('test.jpg')
    height, width = bgrcap.shape[:2]
    while 1:
        bgrcap = cv2.imread('test.jpg')
        bgrcap = cv2.blur(bgrcap, (5, 5))
[

Thank you so much for your work, you helped me a lot for my project
 
Back
Top