Click to See Complete Forum and Search --> : Get Text / Numbers from image


Cha0sBG
April 25th, 2009, 01:28 PM
i'm wondering is it possible to get text numbers from an image in c#?
example image: http://img26.imageshack.us/img26/9097/imageyxx.jpg

if it's possible can someone give a tutorial ? or a pointer to what i need to do?

Thanks in advance
~Cha0sBG

Shuja Ali
April 25th, 2009, 01:43 PM
No it is not possible as of now. May be in the future it might be possible. Have you heard of OCR's?

By the way, isn't that a captcha? What are you trying to do?

Cha0sBG
April 25th, 2009, 02:38 PM
well a friend of mine made a program that generates images like that. And if i make a program to decode those images he'll give me a gift cuz he knows i can't make it :D so i ask for help. And i'll learn some more c# aswell ^^

Shuja Ali
April 25th, 2009, 04:20 PM
well a friend of mine made a program that generates images like that. And if i make a program to decode those images he'll give me a gift cuz he knows i can't make it :D so i ask for help. And i'll learn some more c# aswell ^^
No you can't do it. And this is not the way to learn C#. use some other examples.

Cha0sBG
April 25th, 2009, 04:39 PM
i mean is it possible ... to make a OCR server i dont ask u to give me the code ^^ i just wanna ask is it possible and if it is just a little pointer to what i need to learn to astablish that.

Shuja Ali
April 25th, 2009, 05:11 PM
Honestly speaking, there has been a lot of research done on OCRs and none of them have been 100% successful.

BigEd781
April 25th, 2009, 05:20 PM
Like Shuja said, this is a bad way to learn a language, and it could be used by other people to avoid CAPTCHA's, so no one will post the code here. If you find a way to make 100% effective OCR software, you should tackle some of the NP Complete problems in CS next :)

Cha0sBG
April 25th, 2009, 05:45 PM
i don't want a way to avoid all captchas just those that look like that. Only to avoid the captchas of my friend's program nothing more :D i dont wanna brake captchas of sites etc -.-

Shuja Ali
April 25th, 2009, 05:53 PM
We never said that you want to do that. We only said that if that code exists and that code is posted here it will be misused.

Anyways, Captcha is a security add-on and it is not always easy to beat the security. So you can forget about this little experiment and try doing something else in order to learn C#. Look at this forum, there are number of problems posted here, take one of the problem and try to solve it and see if you can get some learning out of it.

sspoke
April 25th, 2009, 07:08 PM
It's possible it's been on on a game called runescape classic which generated similar images..

what you do is first attempt to create every letter character as accurate to perfect font-type as possible.

This is done by rotating the whole string of words in your case counter-clockwise rotation.
To rotate images look for code on google. (Tons of examples exist I'd look for sprite rotator and rip that code). Now keep testing each rotation to get every letter near 90% or higher maybe even 100% in your case i dont see that much problems in your image its pretty easy to decode.

Now how do get %'s of image words? well you create a pixel array of every letter from A-Z to a-z
and search for these matches using GetPixel API from windows.

Those lines will effect your % but you don't have to worry to much about them but they can be removed as well using the % system.. say you match a Q.. with 100% then erase everything that is extra detected inside it.

It's not that much coding.. the hardest part in my opionion would be getting every letter into a binary array

1's for matches 0's for empty spots..


Now there is another thing which makes this easier each letter has a perfect spacing so you can just use math like x+3 y+5 when you are looping to get the whole word..

without spacing you would have to scan the whole image and find any 99-100% matches and store the locations of x,y start positions into another array then sort that array and lowest y coordinate letter goes first.. etc.. simple

Shuja Ali
April 26th, 2009, 07:14 AM
Well you are talking about a game and not a real captcha. Breaking a captcha is very difficult, although your explanation above sounds simple enough, but I am sure it won't be an easy task.

Cha0sBG
April 26th, 2009, 08:07 AM
ouch :D that looks hard as hell for me :) well first i'll try to rotate the image ^^ i'll post the progress here :P

sspoke
April 27th, 2009, 04:55 PM
Well you are talking about a game and not a real captcha. Breaking a captcha is very difficult, although your explanation above sounds simple enough, but I am sure it won't be an easy task.


wrong.. the game im talking about is the same as a real captcha.. I'd like to add it doesn't matter which way you rotate the image.. counter-clockwise etc.. so don't worry if each different captcha has different way of rotation.. just do a full 360 rotation and each rotation do a check for accuracy of first letter/middle letter.

here is some of the captchas the game im talking about generated

http://images2.wikia.nocookie.net/runescape/images/e/ee/SleepingBagScreen.png
http://runescape.salmoneus.net/rs-classic/images/rssleepword.gif
http://www.runeweb.net/Roth/RSC/fatigue-sleep.PNG

the OCR written for it.. had a 95-100% accuracy and source code was released but it was maybe 8 years ago.. i dont know if its possible to find it now it was written in C++

Cha0sBG
April 28th, 2009, 02:50 PM
well currently i only inverted the colors. Meaning black = white and white = black :P changed the places so to speak. Image attached. Any ideas on how to clean it from the black spots and lines?

BigEd781
April 28th, 2009, 04:03 PM
Again, you are asking how to break a specific CAPCTHA and no one here is going to publicly help you to do it. It doesn't matter what your intentions are, it can be misused by others.

Cha0sBG
April 28th, 2009, 04:58 PM
i just need the cleaning part ... i found the first one only need the second one .. third one "rotation" i'll think of something and the ocr well i think i got it covered

JonnyPoet
April 28th, 2009, 05:18 PM
Please stop to answer to threads like that. This is a forbidden TaskChaptchas are there to prevent hackers like sspoke to be able to use programs to hack HTML pages

It is done to supress the possibility to automatic access to pages which could be used in a way they are not to be used.

In such cases this pictures are done to make sure that only a real person not a machine can use the page and cannot do lots of accesses every minute.

So this is against the forum rules and should be stopped instantly.
sspoke is a known hacker and tries to make a program which allows to overcome such logic and rating games automatically even if rating is only allowed for real persons.

There is a price of 1500 US set for that game with top rating so you can get the idea behind such tasks, maybe chaosBG is simple one of his friends

Look at sspokes latest attempt and at his confession in # 8

http://www.codeguru.com/forum/showthread.php?t=475838

Brad Jones
April 28th, 2009, 07:25 PM
Hacking captchas is not something we need to discusson this forum. It falls into that category of game hacks and creating viruses.

Topic closed.