Giter VIP home page Giter VIP logo

Comments (3)

skotz avatar skotz commented on May 14, 2024

The third parameter of the colorRegions method will help keep letters together when they're made up of separate lines which aren't touching, and the exact_characters setting can be used whenever a CAPTCHA system always has exactly the same number of characters.

These settings seem to work well.

var cbl = new CBL({
    preprocess: function(img) {
        img.debugImage("debugPreprocessed");
        img.binarize(200);
        img.debugImage("debugPreprocessed");
        img.colorRegions(50, true, 3);
        img.debugImage("debugPreprocessed");
    },
    character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
    exact_characters: 5,
    pattern_width: 25,
    pattern_height: 25,
    blob_min_pixels: 10,
    blob_max_pixels: 1000,
    allow_console_log: true,
    blob_console_debug: true,
    perceptive_colorspace: true,
    blob_debug: "debugSegmented"
});

cbl.train("3jrH5.png");
cbl.train("bHaGR.png");
cbl.train("GCXKa.png");
cbl.train("gSBTt.png");
cbl.train("mXTtA.png");
cbl.train("PWRSX.png");

var saveModel = function() {
    cbl.condenseModel();
    cbl.sortModel();
    cbl.visualizeModel("visualizeModel");
    cbl.saveModel();
}

image

from cbl-js.

bearwmceo avatar bearwmceo commented on May 14, 2024

Captchas.zip
I tried with this captchas but It's not working always

from cbl-js.

skotz avatar skotz commented on May 14, 2024

Did you train a model? What's your solver look like? You can check out the quick start for help in getting started.

I ran through the training for the images above and generated this model:

image

You may want to train on more samples or play around with the segmentation settings, but it performs decently.

image

<div class="main">
    <img id="captcha" src="mXTtA.png" />
    <br />
    <input type="text" id="solution">
    <br />
    <a href="javascript: void(0)" id="solve" onclick="solve()" style="display: none">Solve!</a>
</div>
<script>
    var cbl = new CBL({
        preprocess: function(img) {
            img.binarize(200);
            img.colorRegions(50, true, 3);
        },
        /* Load the model we saved during training. */
        model_file: "condensed-30.txt",
        character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
        exact_characters: 5,
        pattern_width: 25,
        pattern_height: 25,
        blob_min_pixels: 10,
        blob_max_pixels: 1000,
        //allow_console_log: true,
        //blob_console_debug: true,
        perceptive_colorspace: true,
        //blob_debug: "debugSegmented",
        /* Define a method that fires immediately after successfully loading a saved model. */
        model_loaded: function() {
            // Don't enable the solve button until the model is loaded.
            document.getElementById('solve').style.display = "block";
        }
    });    
    
    var solve = function() {
        // Using the saved model, attempt to find a solution to a specific image.
        cbl.solve("captcha").done(function (solution) {
            // Upon finding a solution, fill the solution textbox with the answer.
            document.getElementById('solution').value = solution;
        });
    }
</script>

condensed-30.txt

from cbl-js.

Related Issues (20)

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.