Inspiration

My inspiration came from learning how to use Cascade Classifiers which allowed me to do cool things such as hand, face, and eye detection. Over the past few months, I have really plunged deep into OpenCV and the different applications of it.

What it does

Beat the Box! is a simple concept. Use your "controller" to clear the box from the screen by overlapping your "controller" with the box. The "controller" is can be your hand, eye, face, or a yellow sticky note. The boxes can move if desired and there are different times you can choose from(i.e. 30, 40, 50 seconds). After time runs out, a score is calculated based on your "Boxes Per Minute". If you happen to earn the top score in your controller, the high score will be updated on the description page. See the YouTube video to see it in action!

How I built it

I aimed to combine my two favorite libraries, OpenCV and wxPython. I first created the detection algorithms for hand, face, eye, and the sticky note. Once I had detection of the controller, I needed to create a random box that would pop up so the user could hit it. Then, I needed to have the box disappear once the user hit it and up the score. After that, the OpenCV was pretty much was done. For wxPython, I aimed to make a simple interface with a couple options to make the game more challenging. Those options ended up being "Box Movement?" and "Time". Box movement gave a random speed to each box and then the box would move across the screen. I added a dropdown to choose between controllers, added a description box of each controller, and then finally used a big Start button to run the options.

Challenges I ran into

The main challenge of this project was the controller detection. Fine tuning the hand algorithm was especially painful until I figured out that it was much easier to tune if you had a closed fist instead of an open hand. Another problem was how to figure out if the box was inside the controller. This problem was easier because plenty of other people online had asked about this problem. A physical problem that stackoverflow.com couldn't fix was the slow computer I had. I couldn't run the program at the ideal resolution of 640x480 but rather had to settle for 320x240 which certainly lost some accuracy with the controller detectors.

Accomplishments that I'm proud of

I am happy that the whole application worked out as I had envisioned it in the beginning. Sometimes I hit a major roadblock that would stop all progress, but this time, everything fell into place! I am happy to have extended my OpenCV skills to include hand detection.

What I learned

I learned how to detect hands with OpenCV and also learned how to properly setup OpenCV and wxPython together. I learned how to quickly build an application by first breaking down all the parts into small pieces that I could do like figure out how to detect faces. Once I finished one small problem, I just went on to the next until the app was finished.

What's next for Beat the Box!

I plan on using a more powerful computer to run this program at a higher resolution and see just how accurate my algorithms are capable of. I also plan on cleaning up the code and giving some nice comments on what is going on for easier future reference. I think this will make for a fun demo app to friends and family of what computer vision is capable of doing with just some code!

Built With

Share this project:
×

Updates