skotz / cbl-js

JavaScript CAPTCHA solving library
MIT License
155 stars 47 forks source link

Need help to solve captcha with line #39

Open mmoohammed opened 4 years ago

mmoohammed commented 4 years ago

Can you please help to solve this kind of Captcha it is 6 numbers with line (Thank you so much for your examples and your efforts) I just modified the index in the elvincth example as follow : var cbl = new CBL({ preprocess: function(img) { img.debugImage("debugPreprocessed"); img.binarize(168); img.debugImage("debugPreprocessed"); img.convolute([ [1, 0, 1], [0, 1, 0], [1, 0, 1] ], 0.44); img.debugImage("debugPreprocessed"); img.blur(); img.debugImage("debugPreprocessed"); img.binarize(75); img.debugImage("debugPreprocessed"); img.colorRegions(40, true); img.debugImage("debugPreprocessed"); }, character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", blob_min_pixels: 20, blob_max_pixels: 800, pattern_width: 40, pattern_height: 30, allow_console_log: true, blob_debug: "debugSegmented" }); I got this test1 after test4-4


test2-2 test3-3


test3 test2-2

test4 test1-1

please help with this - thank you

6 9 10 11

7 8

skotz commented 4 years ago

Since the system only uses numbers, you can set character_set: "0123456789", and since there are exactly 6 digits in each image, you can set exact_characters: 6. You can also crop off the border and somewhat bypass segmentation by just brute forcing the exact character split (which was recently added and fixed, so please download the latest version of the library).

I'd play around with these settings and see what you can get.

var cbl = new CBL({
    preprocess: function(img) {
        img.debugImage("debugPreprocessed");
        img.binarize(150);
        img.debugImage("debugPreprocessed");
        img.cropRelative(35, 2, 35, 2);
        img.debugImage("debugPreprocessed");
    },
    character_set: "0123456789",
    exact_characters: 6,
    exact_characters_width: 17,
    exact_characters_play: 10,
    blob_min_pixels: 20,
    blob_max_pixels: 1000000,
    pattern_width: 40,
    pattern_height: 30,
    allow_console_log: true,
    blob_console_debug: true,
    perceptive_colorspace: true,
    blob_debug: "debugSegmented"
});

It's not perfect, but it's a start.

image