Step 3Software
> The code run on the image processing PC
> The code run on the PIC-18F microcontroller
> The code run on each of the PIC-12F microcontrollers
There are two prerequisites to install on the image processing PC. The image processing is done through the Java Media Framework (JMF), which is available through Sun here. Also available through Sun, the Java Communications API is used to communicate to the motor control board, across the serial port on the computer. The beauty of using Java is that it *should* run on any operating system, though we used Ubuntu, a linux distribution. Contrary to popular opinion, the processing speed in Java isn't too bad, especially in basic looping (which vision analysis uses quite a bit).
As seen in the screenshot, both the ball and the opponent players are tracked on each frame update. In addition, the outline of the table is located visually, which is why blue painters tape was used to create a visual outline. Goals are registered when the computer cannot locate the ball for 10 consecutive frames, typically indicating the ball fell into the goal, off the playing surface. When this happens, the software initiates a sound-byte to either cheer itself or boo the opponent, depending on the direction of the goal. A better system, though we did not have the time to implement it, would be to use a simple infrared emitter/sensor pair to detect the ball falling into the goal.
All of the software used in this project is available in a single zip file, here. To compile the Java code, use the javac command. The PIC-18F and PIC-12F code is distributed with Microchip's MPLAB software.
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
![]() |
Add Comment
|











































