# I want to learn enough image and video processing to execute a project idea, pointers?

First of all, I am a total newbie to image processing. I have a project idea, part of which will involve doing the following

I have a white board and a camera (a normal webcam by z-star). I will draw a shape
on the white board. The camera will capture the video and process it to identify
the shape I have drawn. To keep it simple, the shapes that can be identified using
by the program will be limited.


I want to execute this idea and will learn anything that is required to make it happen. I want to get started in image processing, but just enough so I can execute this for now. Will incrementally study more. Can you give me any pointers on where to get started?

• This would probably be done on a PC, correct? If so, it's probably better suited for Stack Overflow. If you're working with a low-resource embedded device or FPGA and that's the way you want to learn, feel free to keep it here. – Kevin Vermeer Jan 10 '11 at 18:38
• @reemrevnivek, This discussion has been had in the past, and in general people have argued that DSP should be on our site, as it does not have a good home anywhere else. – Kortuk Jan 10 '11 at 20:15
• @All of those who voted to close. Express your thoughts here: meta.electronics.stackexchange.com/questions/126/… – Kellenjb Jan 10 '11 at 20:39

A good place to start would be to use OpenCV for video processing: http://opencv.willowgarage.com/wiki/

There is a book published by O'Reilly Learning OpenCV: Computer Vision with the OpenCV Library that would probably be a big help.

There are a few steps here that need to be taken.

1. Identify the area you care about. This means either positioning the camera to only include the white board or to do some cropping on your image. If you use black and white images, you can think of them as a 3d array. For cropping you can just say that you will start at column 15 and end at column 506 in order to crop left and right.

2. Now that you have identified the area, you will probably need to do some edge detection. In the simplest sense, edge detection is looking for drastic changes in one pixel to the next. There are ways of doing this "pretty", but for someone that wants to keep it simple you could step through each row of each pixel looking for a jump in value. You may even have to compare to several previous versions depending on how sharp your image is. Create a 3d array that is the same size as your original image. Whenever you see a jump, place some value in your new array. This value could be boolean for simplistic sake or it could be some range that represents how big of jump there was.

3. Now that you have an array that tells you where there are edges it is time to figure out what shape it is. There is a chance you will need to do some filtering on your data before this, but in a perfect world your previous step should just give you whatever you need to know. This is probably the most difficult part. You will need to find someway to define what each object is in a way that a computer can understand. An example of this would be to scan each row, once you find a row that has an edge on it then look at the next row to see if the spacing of the edges is growing. Keep stepping through until you have no more edge and see if it looks like it started out small, then bigger, then smaller.

• Umm.. that would be the process I think. But I am apprehensive about one thing though. My camera takes 640x480 resolution videos at 15 fps. Will my computer be able to step through that much of data in real time? – Rick_2047 Jan 11 '11 at 5:43
• @Rick_2047 I do have to ask if you really need the 15 fps? How fast can the symbols be put on the white board? If 1-2 seconds of latency after the symbol is being drawn then you could easily just use 1 frame per second. – Kellenjb Jan 11 '11 at 6:12
• @Rick_2047 However, you have to remember that the process I have described is mostly comparisons on integers, booleans, and longs. A computer is probably able to do this much faster then it can do some of the more complicated methods of edge detection. – Kellenjb Jan 11 '11 at 6:13
• umm... maybe I can do some trial and error to guess what will be the optimal fps. – Rick_2047 Jan 11 '11 at 6:15

I have no idea how to do it, but maybe you could interface with the new xbox 360 Kinetic device to capture and recognise the shapes.

• Wouldn't that be a over kill? – Rick_2047 Jan 10 '11 at 18:09
• Also I don't have the monies or the xbox. – Rick_2047 Jan 10 '11 at 18:09
• Maybe.... it's just an idea. I think shape recognition is pretty tricky stuff, and I thought that if the kinetic can do it for you then it will save you a lot of hassle! – BG100 Jan 10 '11 at 18:14
• The Kinect is much better for depth perception and 3d modeling of a room. I am not sure it has much help for a problem like this. – Kellenjb Jan 10 '11 at 20:23
• Also I really want to learn all this stuff. – Rick_2047 Jan 11 '11 at 5:44