[Q] recognize letters in my app

CB.NET

New member
Dec 27, 2009
2
0
0
hello,
I'm programming a WP7-App, i have a letter (for example the "A").

How can i recognize the input and match the correct character ?



sorry for my bad english :rolleyes:
 

Ireyn

Member
Aug 25, 2010
33
8
0
You can cast chars to ints.

see: http://www.asciitable.com/

In the table in that link, note that 'A' corresponds to a decimal number 65. When you cast your char 'A' to an int, it will turn into 65.

Similarly, (int)'a' is 97. And 'a' - ch, where ch = 'b', is equal to -1. Doing subtraction of chars automatically converts to integers. Casting the whole string to lowercase and then checking (currentChar - 'a' < 26) is a great way to check if you're looking at an alphabetic character (a through z).
 

CB.NET

New member
Dec 27, 2009
2
0
0
Thanks for the answer...

the "A" is only an example caracter.
in the real world example i use japanese caracters.

the user shall be paint the correct caracter in my app, like this on the picture...
 

Marvin_S

Retired Recognized Developer
Dec 8, 2010
883
239
0
Thanks for the answer...

the "A" is only an example caracter.
in the real world example i use japanese caracters.

the user shall be paint the correct caracter in my app, like this on the picture...
That will be an insanely difficult task. Actually this in general takes years of study in order to accomplish :(

Handwriting recognition is one of the hardest things to accomplish.

If you do want to give it a shot, my suggestion:

Crop and rescale the images, and than determine patterns for each letter, thus an A can be build from 3 linear formules, check if the drawing matches this structure. You can than compute the derivatives of the drawings and from those derivatives cross check them with a database to determine which letter it is.

But this is extremely difficult, we tried to read digits in a sudoku puzzle which was already quite a difficult task to accomplish (and we tried to reference it against a database with images, as well as checking several characteristic points in a figure etc) this went OK with printed letters, but with handwritten it was a disaster. Not trying to discourage you, maybe there are libraries out there which you can use, but I would reconsider what you are trying to accomplish and determine an approach for yourself.
 
Last edited:
  • Like
Reactions: CB.NET

lseidman

Senior Member
Jun 14, 2011
229
103
0
Las Vegas
lance.compulsivetech.biz
Thanks for the answer...

the "A" is only an example caracter.
in the real world example i use japanese caracters.

the user shall be paint the correct caracter in my app, like this on the picture...
I highly recommend making a class of "Cases" this way if it detects "A" it uses the "A" case select opposed to making a ton of "if" and "else" statements.

Better yet... You always could use an if/else statement or have an array of listed recognized items...

Here is something that might help: http://joshsmithonwpf.wordpress.com/2007/06/12/searching-for-items-in-a-listbox.