A simple Captcha parsing algorithm developed for VITacademics.
Clone the repo: git clone https://github.com/karthikb351/CaptchaParser.git
.
Include the CaptchaParser.py
file in the directory you are working in, else install it globally so you can import it from anywhere.
from CaptchaParser import CaptchaParser
img=Image.open("captcha.bmp")
parser=CaptchaParser()
captcha=parser.getCaptcha(img)
print captcha
You'll need the CaptchaParser.js
file within the scope of the node environment so you can require
it.
var captcha = require("../CaptchaParser");
var fs = require("fs");
var buf = fs.readFileSync("captcha.bmp");
var pixMap = captcha.getPixelMapFromBuffer(buf);
console.log(captcha.getCaptcha(pixMap));
Add CaptchaParser.java
to your project. You will have to download image and save it as a File
object.
File image_file = new File("captcha.bmp");
CaptchaParser cp = new CaptchaParser();
cp.setIMAGE_FILE(image_file);
Log.i("Captcha retrieved",cp.getCaptcha());
Have a bug or a feature request? If your problem or idea is not addressed yet, please open a new issue.
Contribute away. Let's see them PRs.
Code released under the MIT license.