## Inspiration

We are a team of goofy engineers and we love making people laugh. As Western students (and a stray Waterloo engineer), we believe it's important to have a good time. We wanted to make this game to give people a reason to make funny faces more often.

## What it does

We use OpenCV to analyze webcam input and initiate signals using winks and blinks. These signals control a game that we coded using PyGame.
See it in action here: <https://youtu.be/3ye2gEP1TIc>

## How to get set up

##### Prerequisites

* Python 2.7
* A webcam
* OpenCV

1. [Clone this repository on Github](https://github.com/sarwhelan/hack-the-6ix)
2. Open command line
3. Navigate to working directory
4. Run `python maybe-a-game.py`

## How to play

**SHOW ME WHAT YOU GOT**

You are playing as Mr. Poopybutthole who is trying to tame some wild GMO pineapples. Dodge the island fruit and get the heck out of there!

##### Controls

* Wink left to move left
* Wink right to move right
* Blink to jump

**It's time to get SssSSsssSSSssshwinky!!!**

## How we built it

Used haar cascades to detect faces and eyes. When users' eyes disappear, we can detect a wink or blink and use this to control Mr. Poopybutthole movements.

## Challenges we ran into

* This was the first game any of us have ever built, and it was our first time using Pygame! Inveitably, we ran into some pretty hilarious mistakes which you can see in the gallery.
* Merging the different pieces of code was by-far the biggest challenge. Perhaps merging shorter segments more frequently could have alleviated this.

## Accomplishments that we're proud of

* We had a "pineapple breakthrough" where we realized how much more fun we could make our game by including this fun fruit.

## What we learned

* It takes a lot of thought, time and patience to make a game look half decent. We have a lot more respect for game developers now.

## What's next for ShwinkySwhink

We want to get better at recognizing movements. It would be cool to expand our game to be a stand-up dance game! We are also looking forward to making more hacky hackeronis to hack some smiles in the future.
## Inspiration

Making learning fun for children is harder than ever. Mobile Phones have desensitized them to videos and simple app games that intend to teach a concept.
 We wanted to use Projection Mapping and Computer Vision to create an extremely engaging game that utilizes both the physical world, and the virtual. This basic game intends to prep them for natural disasters through an engaging manner.
We think a slightly more developed version would be effective in engaging class participation in places like school, or even museums and exhibitions, where projection-mapping tech is widely used.

## What it does

The Camera scans for markers in the camera image, and then uses the markers position and rotation to create shapes on the canvas. This canvas then undergoes an affine transformation and then gets outputted by the projector as if it were an overlay on top of any object situated next to the markers. This means that moving the markers results in these shapes following the markers' position.

## How the game works

When the game starts, Melvin the Martian needs to prepare for an earthquake. In order to do so you need to build him a path to his First Aid Kit with your Blocks (that you can physically move around, as they are attached to markers). After he gets his first Aid kit, you need to build him a table to hide under, before the earthquake approaches (again, using any physical objects attached to markers). After he hides, You Win!

## How I built it

I began by trying to identify the markers - for which there was an already implemented library that required extensive tuning to get working right. I then made the calibration process, which took three points from the initial, untransformed camera image, and the actual location of these three points on the projector screen. This automatically created a transformation matrix that I then applied to every graphic I rendered (eg. the physical blocks). After this, I made the game, and used the position of the markers to determine is certain events were satisfied, which decided whether the game would progress, or wait until it received the correct input.

## Challenges I ran into

It was very difficult to transform the camera's perspective (which was at a different frame of reference to the projector's) to the projector's perspective. Every camera image had undergone some varying scale, rotation and translation, which require me to create a calibration program that ran at the start of the program's launch.

## Accomplishments that I'm proud of

Instead of relying wholly on any library, I tried my best to directly manipulate the Numpy Matrices in order to achieve transformation effects referred to previously. I'm also happy that I was able to greatly speed up camera-projector frame calibration, which began taking around 5 minutes, and now takes about 15-20 seconds.

## What I learned

I learnt a great deal about Affine Transformations, how to decompose a transformation matrix into its scale, rotation and translation values. I also learnt the drawbacks of using more precise markers (eg. April tags, or ARUCO tags) as opposed to something much simpler, like an HSV color & shape detector.

## What's next for Earthquake Education With Projection Mapping and CV

I want to automate the calibration process, so it requires no user input (which is technically possible, but is prone to error and requires knowledge about the camera being used). I also want to get rid of the ARUCO tags entirely, and instead use the edges of physical objects to somehow manipulate the virtual world.
## Inspiration

We were inspired by clowns pieing each other, yet remaining happy during the process.

## What it does

Our product detects a smile on your face, and will slap you.

## How I built it

The facial detection used OpenCV classification with webcam feed into an Arduino controlling a motor.

## Challenges I ran into

We were new to OpenCV and it was difficult to implement.

## Accomplishments that I'm proud of

The idea

## What I learned

OpenCV, and using python libraries to connect to an Arduino.

## What's next for Smile Away

Tasers