For our group (nicholas makoto, goh chersee,xinfeng, maung phyo win zaw), we’ve decided to create a color based detection system for the pong controller. To use it, we’ve placed 2 differently colored foam pads, one is green, and the other is purple. The closer the colored pieces are, the more the pong paddle would go in one direction. For this assignment, we’ve decided to use a digital controller, which would cause the paddle to only move in one speed.
The way this works is as follows. The “suckah” tab is placed over a camera feed and users can then click on a specific color to drawn. The color swatch is attached to the “suckah” tab to let users know what color is being registered. Once that is done, a rectangle is drawn, taking in the top left, right and bottom left and right coordinates. We used a mathematical expression to derive the area of the rectangle and created an if statement which moves the tab if it hits a certain threshold value.
An alternate way of calculating the value which was suggested was to take the differential area values between the green and purple value and use that to determine the position of the paddle, which would effectively make it an analogue controller. We’ve initially decided to use a color sensor, but due to the limitations of calculating and extracting different color values, and cost constraints of getting the sensor itself, we’ve decided against it. All we needed was a proof of concept placeholder that would still accomplish the final result of moving the paddle using a particular color.