skotz / cbl-js

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

Help with this example with circles and different colors #50

Open dsalcedo opened 4 years ago

dsalcedo commented 4 years ago

sat1

sat2

sat3

sat4

sat5

img.removeGray(5);
img.binarize(150);
img.colorRegions(300, true);
Captura de Pantalla 2020-02-25 a la(s) 5 07 33 p  m

But not solved 🤔

skotz commented 4 years ago

You could try removing the binarization step completely and directly re-coloring each blob. The idea would be to extract the circles outlining the letters instead of the letters themselves. The weakness of this CAPTCHA is that each letter is a different color, so you don't want to flatten the image to just black and white and lose that extra information.

var cbl = new CBL({
    preprocess: function(img)
    {
        img.debugImage("debugPreprocessed");
        img.colorRegions(5, true, 5);
        img.debugImage("debugPreprocessed");
    },
    exact_characters: 6,
    character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
    blob_min_pixels: 100,
    blob_max_pixels: 10000,
    pattern_width: 25,
    pattern_height: 25,
    perceptive_colorspace: true,
    allow_console_log: true,
    blob_console_debug: true,
    blob_debug: "debugSegmented"
});

image

Another option plays on the observation that there are always 6 characters and they're always in the same locations... You can mark the fixed character locations like this example.