Essentially, an alarm clock that forces you to solve a scrambled rubiks cube to turn it off.
Please read the readme file for instructions!
Claude for debugging quadrilateral detection
Essentially, an alarm clock that forces you to solve a scrambled rubiks cube to turn it off.
Please read the readme file for instructions!
Claude for debugging quadrilateral detection
🔥 AVD marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)
I built an alarm clock that stops only when you present it with a solved rubik’s cube. I did have trouble figuring out how to actually get it to verify that it was a solved cue, but by letting it find 3 solved sides from an angle, I was able to let it finally work. The details are in the readme and demo video.
I wasn’t exactly sure if the demo was supposed to be a video or something else, (also beware of headphone volume idk what happened) but if there are any issues, pls lmk!
Debugging and running the code on the pi continuously to TRY AND GET THE COLOUR DETECTION TO WORK WITH MY CRAPPY WEBCAM AHGDHSFHHHH (idk if this is the correct hackatime workspace or wtv that i added but the time looks abt right) but it does work now hahehahehaha….
Log in to leave a comment
I fixed the edge detection & corner detection for scanning and applying masks. Now it actually says that there are four corners found, but before, it was saying there were six, or five, or three, which meant it wasn’t a quadrilateral. This was fixed by stronger morphological operations which took me quite a while to figure out…
Log in to leave a comment
it now kinda works on the pi but the colour detection isnt fully working for some reason..
it does stop though
Log in to leave a comment
woo it works! almost ready to ship! (havent tested on raspberry pi YET), HOWEVErRRRRRR the code now can detect if the cube is a quadrilateral , and correclty identifies all colours, and it somehow actually works on a mildly saturated background!
Log in to leave a comment
More robust testing to check if it’s solved. If there are opposite sides on the cube that are detected (e.g. blue & green at the same time), and are both over 5000 pixels in area (the threshold value), it will not detect it as solved, since there are impossible colours.
Figured out the logic for detecting sides! And also integrated it into the alarm. Now all that’s left is to further add some more verification for detecting if it’s solved or not, and then migrating it to raspberry pi :)
output is attached below when i run the detection:
Log in to leave a comment
First ~2h30m is mostly finishing the freecodecamp tutorial (https://www.youtube.com/watch?v=oXlwWbU8l2o).
Next ~1h was spent making the detection file, where it creates masks and detects if there are three or more colours shown in the picture. If there are, it returns True. trying to find the right upper and lower bounds killed me :(
Log in to leave a comment
Today (and the following ones) will probably be largely just learning the basics of OpenCV.
The code can currently detect edges & contours, but will probably need to be modified VERY heavily cuz… well… you can see the image… but progress is progress!
Today’s progress - I can now: