skotz / cbl-js

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

What is the blob size of this image? #25

Closed stakkitupp closed 5 years ago

stakkitupp commented 6 years ago

img.binarize(220);

blob_min_pixels: 50, blob_max_pixels: 500, pattern_width: 20, pattern_height: 20,

I tried this one but when it go to segmented the size of each number is wrong .

stakkitupp commented 6 years ago

Refer to my old account, sorry for duplicate questions

skotz commented 5 years ago

Sorry, I didn't see this question until now. If this is still an issue, please reopen the ticket and provide your full script.

Elvincth commented 5 years ago

img.convolute([ [1, 2, 1], [1, 5, 1], [1, 2, 1] ], 1/10); img.binarize(190); img.colorRegions(45, true);

Elvincth commented 5 years ago

Tried this code for the captcha but seems to small detect

skotz commented 5 years ago

Is this question regarding the same images at the start of this ticket?

Elvincth commented 5 years ago

Yes I think I am working on the same cpatcha

skotz commented 5 years ago

The first thing to note is that the characters are a different color than the background noise, so a good img.binarize(190) separates out the colors really well.

There are always 4 characters, so you can use the new exact_characters: 4 option to always split large sections into smaller ones. Note that you'll need to download the latest version of the library to use that since I just added it.

image

With these settings you should be able to get high accuracy on this one.

var cbl = new CBL({
    preprocess: function(img) {
        img.debugImage("debugPreprocessed");
        img.binarize(190);
        img.debugImage("debugPreprocessed");
        img.colorRegions(50, false, 1);
        img.debugImage("debugPreprocessed");
    },
    character_set: "0123456789",
    exact_characters: 4,
    pattern_width: 16,
    pattern_height: 16,
    blob_min_pixels: 10,
    blob_max_pixels: 200,
    allow_console_log: true,
    blob_console_debug: true,
    blob_debug: "debugSegmented"
});
Elvincth commented 5 years ago

Wow , cool new featureļ¼Helped us a lot