CAD
The modeling for this project was the first complex modeling challenge. The first issue was designing the lever/ triggering mechanism. There were a few different design options. Examples of options are a 3-arm tool to push the button, a bevel roller, or an elliptical lever arm. With the elliptical lever arm, we can get more mechanical advantage with a smaller servo. The math was easy to figure out as we took an oval shape and rotated on a graph to determine the rotation axis and to what degree the lever had to turn to create the arm.
Programming
The programming project is two separate codes that interact with each other. The decision-making is being run on my computer in C++.
I am using the OpenCV library to access my computer camera and to gain the prewritten algorithm to train the ai. The program has two functions, tracking the face and identifying the face. To achieve this, I use a Haar Cascade, which tries to remember a vital feature of a look. I made a simple draw function to show where the face is on the screen, which will cut and crop the image in that square.
Before the image is sent to the identifying function, it is converted to black and white for two reasons. First, to remove any noise and to reduce processing power for the neural network to identify. As if we are only looking for a brightness value from 1-255 per pixel vs. 1-255 RGB values per pixel, we effectively reduced processing power by three times.
The identifier function will now give a binary answer, such as 0 or 1, to tell if the person is cleared.
Now to target the function that crops the image does multiple things. I can now take the center point of the cropped image to gain an x and y coordinate, but how about distance? I took measurements and interpolated the distance of a person.
So the software outputs 0 or 1 to determine if the person is a target and position coordinates, x,y,d. This is where the software on the Arduino comes in. It is a simple equation to convert rectangular coordinates into polar coordinates for the motion of the x and y distances. There is another function to attempt to interpolate the arc of the silly string over the distance d.