Closed paulebe closed 5 years ago
I solved...But it is not properly segmented...
It looks like the border is getting in the way. You could try using the crop command first to cut it off, but I think the easier way is to set blob_min_pixels
to something small enough to filter out the large border blob while still allowing the letters through.
@skotz could you provide me the solution code?
What's your current code look like?
What's your current code look like?
var cbl = new CBL({
preprocess: function(img) {
img.debugImage("debugPreprocessed");
img.convolute([ [1, 1, 0],
[1, 2, 1],
[0, 1, 0] ], 1/6);
img.debugImage("debugPreprocessed");
img.binarize(242);
img.debugImage("debugPreprocessed");
},
/* The set of characters that could potentially be in this CAPTCHA system. */
character_set: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
/* The minimum number of pixels required to call a grouping of similar pixels a blob. Use this to filter out small specks before segmentation. */
pattern_width: 20,
/* The height of the extracted blobs. All patterns are normalized to this height. */
pattern_height: 20,
/* Enable advanced logging in the browser's console. */
allow_console_log: true,
/* Compare the differences between colors using algorithms based on how the human eye perceives color (instead of just an RGB comparison). */
/* The ID of the element to output all work-in-progress images of segmented characters from each image. */
});
Try specifying the min and max blob sizes.
blob_min_pixels: 10,
blob_max_pixels: 150,
And adding a call to colorRegions
as the last command in the preprocess
section.
img.colorRegions(50);
Try specifying the min and max blob sizes.
blob_min_pixels: 10, blob_max_pixels: 150,
And adding a call to
colorRegions
as the last command in thepreprocess
section.img.colorRegions(50);
It is not working in most cases..
I'd recommend that you continue to play around with the image manipulation methods. This one might be a bit tricky, but it looks doable.
E.g 1.
2.
3.
4.
5.
![5](https://user-images.githubusercontent.com/21983722/45860766-9ce01a80-bd86-11e8-98a0-8a16c31e7b5a.jpg)