Git Product home page Git Product logo

Comments (2)

skotz avatar skotz commented on May 18, 2024

This may be difficult to get good accuracy on since it's using upper case, lower case, and similar characters (e.g., "1" and "I" and "l").

Here's something to get you started:

var cbl = new CBL({
    preprocess: function(img) {
        img.debugImage("debugPreprocessed");
        img.binarize(220);
        img.debugImage("debugPreprocessed");
        img.convolute([ [1, 0, 1],
                        [0, 1, 0],
                        [1, 0, 1] ], 1/3);
        img.debugImage("debugPreprocessed");
        img.blur();
        img.debugImage("debugPreprocessed");
        img.binarize(200);
        img.debugImage("debugPreprocessed");
        img.colorRegions(40, true);
        img.debugImage("debugPreprocessed");
    },
    character_set: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
    blob_min_pixels: 50,
    blob_max_pixels: 500,
    pattern_width: 20,
    pattern_height: 20,
    allow_console_log: true,
    blob_debug: "debugSegmented"
});

It works pretty well. The convolution filter will remove most of the purely horizontal or vertical lines. The only image that this didn't get all the characters out of was the nW2Y image, but that's because the lines between the middle two characters were thick enough to not get removed. If you play around with the settings on more than just these 6 images, you should be able to improve the segmentation.

segmented

Here are the extracted letters after segmentation for all 6 images:

trained-model

And here's the model visualization after condensing and sorting:

condensed-sorted-model

from cbl-js.

Elvincth avatar Elvincth commented on May 18, 2024

@skotz Thank!

from cbl-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.