I need to find letters in a image. I need a help to write an algorithm to decode the image.
I got the image an there is converted in a ByteArrayOutputStream
but I don´t know what I do with it.
There is my java code:
URL url = new URL(urlImg);
WebClient webClient = new WebClient(BrowserVersion.getDefault());
WebRequest reqImg = new WebRequest(url);
reqImg.setHttpMethod(HttpMethod.GET);
InputStream imgStream = webClient.getPage(reqImg).getWebResponse().getContentAsStream();
BufferedImage img = ImageIO.read(imgStream);
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(img, "png", out);
Dependencies: net.sourceforge.htmlunit htmlunit 2.15
JDK 1.6.0_43
http://scraping.pro/example-captcha-solver-java/
I noticed that you're using Java, this is a way to do it in Java. Decoding Captchas is very possible, assuming the captcha is not very secure. This is exactly why captchas are always getting more complex - people can break them.
Edit If you aren't hard set on Java and don't want to use a paid service, you could use this tutorial with Python: http://www.boyter.org/decoding-captchas/
-By the way- Decoding Captchas is not always unethical. Sometimes it is required or makes life much easier. For example a company I'm working with will not disable the Captcha on their sites for automated tests that I've made. If I wanted to run my automated tests, I'd have to bypass the Captcha. Granted that also means other people can also bypass the Captcha if they really wanted to, but the company apparently doesn't care and wants easy to read, traditional Captchas.