Two computers duke it out on Pong

Pong: COM vs. COM - Image 1 Pong: COM vs. COM - Image 2 

Bored of playing Pong all by yourself with nobody around for you to play with? Why not let two computers compete in Pong?

Ashish Derhgawen thought of the idea after he saw someone’s elaborate image-recognition setup that lets two laptops play a WTF: Work Time Fun minigame on his PSP, which involves a webcam taped to the screen on the PlayStation Portable, and a motor hammering at the PSP’s ‘X’ button.

The programmer, who created his own version of the Pong game in his earlier days, created a similar setup using his webcam to detect Pong movements on one of his two PCs using edge detection to better sense the ball and bat.

Edge detection is used to ‘see’ the edges of the shapes in the Pong screen to differentiate the ball from the bat, and sends the data to the other computer so it could react appropriately in order to move the bat and hit the ball.

He then created a code for image recognition and wrote a TCP client/server program for the two computers to communicate and square off against each other at Pong. Ashish also thought of using a simple motor to hit at the keys, much like the Work Time Fun setup, but deemed it to be needlessly complicated when the TCP client/server would serve the same purpose.

It may be an complex way of letting computers play with each other (there’s always a COM vs. COM mode in most fighting games) but hey, the most fun about this project is in setting it up, don’t you think?

A video demonstration after the jump!

Pong: COM vs. COM - Image 1 Pong: COM vs. COM - Image 2 

Bored of playing Pong all by yourself with nobody around for you to play with? Why not let two computers compete in Pong?

Ashish Derhgawen thought of the idea after he saw someone’s elaborate image-recognition setup that lets two laptops play a WTF: Work Time Fun minigame on his PSP, which involves a webcam taped to the screen on the PlayStation Portable, and a motor hammering at the PSP’s ‘X’ button.

The programmer, who created his own version of the Pong game in his earlier days, created a similar setup using his webcam to detect Pong movements on one of his two PCs using edge detection to better sense the ball and bat.

Edge detection is used to ‘see’ the edges of the shapes in the Pong screen to differentiate the ball from the bat, and sends the data to the other computer so it could react appropriately in order to move the bat and hit the ball.

He then created a code for image recognition and wrote a TCP client/server program for the two computers to communicate and square off against each other at Pong. Ashish also thought of using a simple motor to hit at the keys, much like the Work Time Fun setup, but deemed it to be needlessly complicated when the TCP client/server would serve the same purpose.

It may be an complex way of letting computers play with each other (there’s always a COM vs. COM mode in most fighting games) but hey, the most fun about this project is in setting it up, don’t you think?

Add a Comment

Your email address will not be published. Required fields are marked *