C# - OCR - Tutorial

I agree,Most sites are re-hashed garbage.There isn't much info on this sort of thing so i figured why not give back a little. Im %99 sure this is how captcha sniper works,My intentions are not to ruin their sales.

Don't worry about captcha sniper because it solves only easy captchas, they didn't build the first OCR software.

ReCaptchas made by google are a more bigger challenge, the letters are joined and twisted.

I have been thinking about matching the lower part of a letter, and then trying to modify the letter until it overlaps, but where a letter starts and another ends? Maybe a partial match between a letter and then observing that the shape of the letter isn't continuing as a letter like between "ot"
We could get the orientation and the number of letter from the white space on the lower part.

Is a lot of work, it would be slow, and and need AI
 
Looks good, have you done much testing around the memory leaks with TessNet/Tesseract? At one point I wanted to create a web service to solve captchas such as these much the same as decaptcher, and then use a thirdparty/manual input if they couldn't be solved.

I used a pretty similar strategy. Here is what my app sort of ended up looking like half way through. It has gone through a few changes now to make it more streamlined.

rj9NB


I wanted to get away from using something like Tesseract (Since at the end of the day, what it does is out of your control) and build my own way of identify letters using curves/endpoints etc.
 
Nice share but it would be much better if you can share the total links all together.
 
Looks good, have you done much testing around the memory leaks with TessNet/Tesseract? At one point I wanted to create a web service to solve captchas such as these much the same as decaptcher, and then use a thirdparty/manual input if they couldn't be solved.

I used a pretty similar strategy. Here is what my app sort of ended up looking like half way through. It has gone through a few changes now to make it more streamlined.

rj9NB


I wanted to get away from using something like Tesseract (Since at the end of the day, what it does is out of your control) and build my own way of identify letters using curves/endpoints etc.

@OP: Nice tutorials. It's exactly what Captcha Sniper does. If people want to get into more advanced captcha cracking look into neural nets for character recognition. There is an online course on it being offered on coursera right now.

Nice looking GUI :)

To get rid of memory problems with tesseract you can code your own memory manager by hooking VirtualAlloc/RtlAllocateHeap/HeapCreate/VirtualFree/etc... if you know enough ASM/low level programming. It's a pain in the ass but it's the only way to get tesseract consistently running for weeks at a time without editing their source to fix bugs. However, tesseract is way too slow for a lot of heavy duty cracking that needs to be done fast (think 50 threads at a time). In this case you'll need to code your own neural nets and train them, which is really easy.

You don't want to do character recognition on shape context matching (what you call curves/endpoints). I've done it to crack recaptcha, but it's a royal pain in the ass and takes weeks to do. It's the absolutely last resort for captcha cracking. You usually want to train your own neural net for recognition of individual characters. I recommend you use Aforge.Imaging to preprocess images, but that you code your own neural nets/blob detection algorithms (for character segmentation). The Aforge stuff, despite being C#, is too heavyweight and has weird threading issues/memory footprints. Of course I'm just lazy and never dove into their code, so maybe you can fix that :P
 
Very inspirational indeed. I can definitely put this info to good use. Thanks for an excellent tutorial, mate.
 
Looks good, have you done much testing around the memory leaks with TessNet/Tesseract? At one point I wanted to create a web service to solve captchas such as these much the same as decaptcher, and then use a thirdparty/manual input if they couldn't be solved.

I used a pretty similar strategy. Here is what my app sort of ended up looking like half way through. It has gone through a few changes now to make it more streamlined.

Man, could you share the split letters code, plase? I need it, but i can't do it by myself.
 
Thank you all for the kind words and sorry for the delay,I Just finished up a large project.I plan to add more to the blog and unlock the forums.If anyone needs any help or has any requests feel free to post here.


Looks good, have you done much testing around the memory leaks with TessNet/Tesseract? At one point I wanted to create a web service to solve captchas such as these much the same as decaptcher, and then use a thirdparty/manual input if they couldn't be solved.

I used a pretty similar strategy. Here is what my app sort of ended up looking like half way through. It has gone through a few changes now to make it more streamlined.

rj9NB


I wanted to get away from using something like Tesseract (Since at the end of the day, what it does is out of your control) and build my own way of identify letters using curves/endpoints etc.

Great work! When I started this project,I wanted to add multiple engines and based on the "confidence level" that would be the engine to use,Much like your screenshot :p Then I wanted to add a feature to the tess engine where the app will try each "image cleansing" method,Record confidence,Repeat,Then based on stats : Generate a report,So the entire process is pretty much automated.
 
Last edited:
Great tut! Really well done.

Would there be interest in another OCR tutorial? I could write one up real quick and post it in a separate thread. I've got a lot of experience with neural networks as well as vector space search engines. Could post this up in C++ or similar, it's applicable to any language really.
 
Great tut! Really well done.

Would there be interest in another OCR tutorial? I could write one up real quick and post it in a separate thread. I've got a lot of experience with neural networks as well as vector space search engines. Could post this up in C++ or similar, it's applicable to any language really.

Of course :)
 
Hey guys, I just started a new thread over at the "General programming" subforum. Check it out. Just posted an introductory part, no code yet. Will get to the main part by lunch break today. Cheers
 
Back
Top