RS

Rubik's Robot

[HOBBY PROJECT] A robot that can solve a Rubik's Cube!

Finally got mask working for white! (it also detects the background but that's not a problem)

Loop through color constants and show the calculated mask for each one

Created a getMaskRangesForColor function which returns the threshold ranges for a color constant

Created a getImageMaskForRanges function which can handle multiple threshold ranges eg. red has two ranges because it wraps around from 179 to 0

Created a getImageMaskForRange which takes in an image, lower array and upper array and outputs a mask

Created a multiChannelApplyMask function based on a nice solution I found in a GitHub issue

Wait 1 second if loading image from camera so it has time to adjust to lighting

Had a play around with color thresholding in opencv4nodejs using example code

Super happy with my progress today!!! I honestly thought getting to this point would take weeks, but it's only taken one (intense and mind-warping) day to do it all!!!

Gabriel Arazas

That's quite awesome! I'll try this with the real one later. Mind sharing me some resources/references for looking into this (aside your code, of course)? :)

0 Likes
Gabriel Arazas

A little bit of both (though any resources will do).

0 Likes

Tested parsing from notation and executing the moves correctly with a bunch of different algorithms! For example the "fishy" algorithm below... You can see the fish shape made of white 0s on the first face

Committed and pushed the code so far to GitHub!! Take a look if you're interested ๐Ÿ‘‰ https://github.com/Booligoosh/rubiks-robot