gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Recognizing shapes - How?

#134689 - Snaeng - Sun Jul 15, 2007 9:41 pm

Hello.

I'm still new to this and I already read some tutorials (there aren't many good..), but there's something I'm really interested in which I can't find any information about.

What I mean is recognizing shapes. To let the User draw a picture and then the game should check which sign or shape it is.
Like in Dr. Kawashimas Brain Jogging in some exercises you can paint on the touchscreen letters like "a" or "d" and the game is recognizing them. Also special chars like "@" or "$" are possible.

But how do I do that? Are there some special functions? Or do I have to write all the code on my own? If so, how to write the recognition-code?

Hope someone can help me here! :)

#134690 - relpats_eht - Sun Jul 15, 2007 9:53 pm

There are no special functions, you will have to write the code on your own. A simple neural net would likely do the trick, although, someone else may have a simpler method than that.
_________________
- relpats_eht

#134691 - Dwedit - Sun Jul 15, 2007 9:59 pm

Welcome to the world of "Computer Vision". Now hit the journal sites and look for the multitude of published articles on the subject.

A simple way to detect lines is the Hough Transform. You have your image bitmap, and a 'function bitmap'. You think of each point as an infinite number of lines possibly going through that point. So this means you transform a point into a function of R and Theta, then graph the curve on the second bitmap. Where many curves intersect is the detected line. Usually this is all implemented by adding a 'vote' while graphing the curve, then finding which points have the most votes.

But hough transform is probably not too good for letter recognition.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#134693 - Snaeng - Sun Jul 15, 2007 10:32 pm

Hought Transformation sounds pretty tough.. I think that's going far beyond my understanding for now, but I can't know until I try.

Are there any other methods?

And I want to be able to recognize if the user wrote letter, or hiragana (Japanese signs).
These for example are Hiragana:
[Images not permitted - Click here to view it]

#134702 - relpats_eht - Mon Jul 16, 2007 12:13 am

Neural nets are probably the way to go if you are going to be that diverse in recognition. There is plenty of information on them, but you probably want to focus on OCR through neural nets, so search for something along those lines.
_________________
- relpats_eht

#134742 - Noda - Mon Jul 16, 2007 8:56 am

Check the PA_Reco function in the PALib, it's exactly what you're looking for, and it's much simpler & efficient than a neural network ;)

#134745 - simonjhall - Mon Jul 16, 2007 9:21 am

Neural nets for this sort of thing would be overkill. I'd recommend looking up 'shape contexts' - they're part of an easy way of recognising free-flowing, simple shapes. I used them in my final project at uni to recognise hand gestures and basic sign language stuff...

Btw the hough transform wouldn't really be so hot for this, as it's geared primarily for recognising parametric shapes (ie shapes definable with a formula). You could use the generalised hough transform (which can match arbitrary shapes) but would probably be too computationally intensive for this DS...
_________________
Big thanks to everyone who donated for Quake2

#134749 - Snaeng - Mon Jul 16, 2007 10:21 am

Shape contexts sounds interesting (Also does neural networks).
Do you maybe have an tutorial or something like that for this, shape contexts?
It's hard to find good tutorials for neural networks.

#134753 - silent_code - Mon Jul 16, 2007 12:43 pm

browse some university pages ;)

#134843 - josath - Tue Jul 17, 2007 4:50 pm

relpats_eht wrote:
Neural nets are probably the way to go if you are going to be that diverse in recognition. There is plenty of information on them, but you probably want to focus on OCR through neural nets, so search for something along those lines.


http://davr.org/nn.jpg