skotz / cbl-js

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

I can't make a trainer #60

Open Nipis opened 3 years ago

Nipis commented 3 years ago

46BH DGPC M7FN MFMM N6YJ RTAJ Y2TP

var cbl = new CBL({ preprocess: function(img) { img.debugImage("debugPreprocessed"); img.removeLight(230); img.debugImage("debugPreprocessed"); }, character_set: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", exact_characters_width: 26, exact_characters_play: 4, exact_characters: 4, blob_min_pixels: 300, blob_max_pixels: 10000, blob_max_width: 80, pattern_width: 50, pattern_height: 50, allow_console_log: true, blob_console_debug: true, perceptive_colorspace: false, blob_debug: "debugSegmented" });

skotz commented 3 years ago

This one might be difficult due to the noise, colors, and potentially overlapping letters. I think what you want to play around with is the pixel jump setting (third parameter of colorRegions) to hopefully connect all of the darker grey pixels into single characters.

Here's a good example.

Basically that'll consider pixels to be part of the same blob even if they're n pixels away from each other.

Seems like the other settings you have are heading in the right direction.

Nipis commented 3 years ago

Thanks!

Now I have this error when I click on Solve

image

skotz commented 3 years ago

Without seeing all the code, I'd guess there's probably a reference to a div id that doesn't exist. So if you have blob_debug: "debugSegmented" then you need a <div id="debugSegmented"></div> somewhere. Same for img.debugImage("debugPreprocessed") and cbl.visualizeModel("visualizeModel") and anything else that references a div id.

skotz commented 3 years ago

And if it's when you click solve then it's probably missing one of these:

cbl.solve("captcha").done(function (solution) {
    document.getElementById('solution').value = solution;
});
<img id="captcha" src="someimage.png" />
<input type="text" id="solution">
Nipis commented 3 years ago

Sorry, this was the error: img.debugImage("debugPreprocessed"); It's solved.

Thanks!!