Giter Club home page Giter Club logo

captcha-text-extraction's Introduction

Captcha-text-extraction

Introduction

This captcha text extractor uses open cv and keras to extract the text. It uses a CNN model trained on the seprate images of letters of the captcha. It takes an input image, output folder, cnn model and a lablebinarizier file and returns an output image with predicted captcha text as image name and also displays the output showing the predicted captcha text.

How it works

  1. Read the image using open cv
  2. Apply threshold
  3. Find contours
  4. Extract the image regions containing letters
  5. Use the trained model to predict the letters
  6. Combine the predicted letters
  7. Display the results

Files Description

  • captcha.ipynb: It extracts the captcha images into separate images of letters. It also containes the complete project as jupyter notebook.
  • captcha_extractor.py: Extract the captch text, save and display the output captcha image.
  • captcha_extractor_model.hdf5: Trained CNN model used for prediction.
  • captcha_labels: Holds the labelbinarizer needed to predict the letters.
  • test_sample_captcha.png: It is a sample captcha image for testing.

Libraries required:

  1. open cv
  2. keras

How to use

captcha_extractor.py needs few arguments:

  1. --input: Path to the input png captcha image.
  2. --output: path to the output folder.
  3. --model: path to the 'captcha_extractor_model.hdf5' file.
  4. --labels: Path to the captcha_labels file

Sample

$python captcha_extractor.py --input test_sample_captcha.png --output ./out --model captcha_extractor_model.hdf5 --labels captcha_labels

captcha-text-extraction's People

Contributors

chauhan01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.