Hello everyone,
I warn you that I do *not* know what I'm talking about - I ordered a Parallella to learn more about parallel programming problems and I'm looking for fun problems the board could help me solve.
While playing and losing badly in the hardest mode I wondered if I could write a bot for the game. For those who don't know the game (also watch the trailer linked above): You control a triangle which moves around a geometric figure such as a square or pentagon in the middle of the screen. The sides of the figure extend to the edge of the screen. On the extended sides there are different barriers which are moving fast towards the middle of the screen (and thus the triangle the player controls) and the goal is to avoid these barriers for as long as possible.
To solve this problem I would need:
* A way to get image data from a computer running the game to the Parallella board. I guess getting image data from VGA would need a daughter card in any case and I do not believe reading the uncompressed RGB data from DVI/HDMI would be directly possible. USB frame grabbers appear to be too expensive. Grabbing the image data on the host computer and sending it via Ethernet should work and be "easier" (I'm a software guy...).
* Analyze the images to detect the position of the triangle, the extended sides and barriers. Only having three colors and easy geometric forms makes the task seem relatively easy for a still image, but this is made a lot more difficult by bouncing with the beat, very fast rotations and to a lesser extend changing colors (but not changing contrast); particularly if done in real-time.
* Determine the movement of the triangle (if any) to avoid collision with upcoming barriers.
* Have the Parallella work as USB-HID class device to the computer running the game and send the keys for "move to the right" or "move to the left".
All of the sub-problems sound like fun, but:
a) Could I do this with a Parallella? (Is the Parallella and are the connections from, to and inside the Parallella fast enough?) 640x480x24@30fps uncompressed uses about 211MB/s (Gigabit Ethernet has theoretically 1000MBit/s or 125MB/s) which should be doable looking at the raw numbers for the interconnects on the board. I have no idea how difficult a task image recognition is and if my 16 core version would be able analyze a frame in, say, less than 20ms. The AI and HID parts should be comparatively straight-forward.
b) Should I try to do this with a Parallella? I have very little knowledge about parallel programming and image recognition and to me this sound like a difficult problem due to the real-time aspect needed for controlling the game and the thus necessary optimization work. I might have just as much fun with a cheap USB web cam and simple kinect-like shape recognition tasks without having the real-time constraint.
I would appreciate if someone more knowledgeable could try to answer my questions and help me judge the feasibility and sensibility of such a project.
Regards,
Johannes