cbl-js
cbl-js copied to clipboard
Help with this example with circles and different colors
img.removeGray(5);
img.binarize(150);
img.colorRegions(300, true);

But not solved 🤔
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"
});
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.