Random header image... Refresh for more!

Category — Crazy Weekend Project 1: Pong Robot

It’s Not About Doing It Right, It’s About Doing It Right Away.

Dirty hacks are permissible on Crazy Project Weekend.

Dirty Hacks Are Permissible

If you can’t get the lines drawn as an overlay on top of the window, then draw them directly on top of the images.

September 7, 2009   No Comments

Drawing Lines

I don’t remember Windows.Forms being this stupid.  All I’m trying to do is draw an overlay of lines between two images.  Why are you making that so hard?

September 7, 2009   No Comments

About the TV Screen

Trying to use a real TV screen will pose a couple of problems.  First, I have to find the TV screen in the image.   Then, once I have the TV screen, I’ll have to do something about the distortion.  There will be two types of distortion.  First is perspective distortion, since I can’t assume that the camera is facing the TV screen head on.  Then, of course, since this is a typical CRT TV, there’s the curve of the screen to take into account.

I’m going to rely heavily on user input to calibrate the display.  My idea is that the user will have to click several points on the video image that correspond to points on the playfield.  Then, hopefully, I’ll be able to fix the distortion in the image and have a playfield image that’s nice and square to use.

It will look something like this:

CameraCalibration

There.  Wasn’t that simple?

Of course, it would be totally awesome if I could simply feed it an image of what I expect to see, then have it find that image in the video and undistort everything for me.  However, I haven’t quite read that chapter yet…

September 7, 2009   No Comments

Okay, Now Get Back To Work

I hooked up the webcam and noticed the edge detector and contour recognition displays going wild.  So, I got a little side-tracked…

Star Trek

I am definitely going to have to play around with OpenCV some more when I’m done with this robot project.

September 7, 2009   No Comments

But first…

It’s time for a bit of refactoring.  My main() is something like 200 lines of code that doesn’t belong all in one place.  I had been trying to keep everything in the PongLogic class, but that fell apart after a while.  Gotta take care of that.

September 7, 2009   No Comments

So Now What?

So, the robot won a game. It won largely on luck, though, it was making plenty of mistakes along the way.  But, it’s now time to move on.

See, it’s all well and nice that it can play based on the video signal from a  TV input card fed directly from the Atari into the computer.  But that’s not terribly practical, is it?  Who has a TV input card to hook an Atari up to?  What do people usually play Atari on?

Static

They play on Channel 3.

This is going to complicate things…

September 7, 2009   No Comments

Now I have to implement the “Smack Talk” feature…

EPIC WIN

Booyah!  Chew on that, Stella!

September 7, 2009   No Comments

One Down…