Giter VIP home page Giter VIP logo

Comments (1)

henrivain avatar henrivain commented on May 28, 2024

Pull request #19 fixes this issue

Example

private async void DEMO_Recognize_AsConfigured(object sender, EventArgs e)
{
    // Select image (Not important)
    var path = await GetUserSelectedPath();
    if (path is null)
    {
        return;
    }

    // this Tesseract is injected property
    Tesseract.EngineConfiguration = (engine) =>
    {
        // Engine uses DefaultSegmentationMode, if no other is passed as method parameter.
        // If ITesseract is injected to page, this is only way of setting PageSegmentationMode.
        // PageSegmentationMode defines how ocr tries to look for text, for example singe character or single word.
        // By default uses PageSegmentationMode.Auto.
        engine.DefaultSegmentationMode = TesseractOcrMaui.Enums.PageSegmentationMode.Auto;
        
        engine.SetCharacterWhitelist("abcdefgh");   // These characters ocr is looking for
        engine.SetCharacterBlacklist("abc");        // These characters ocr is not looking for
        // Now ocr should be only finding characters 'defgh'
    };

    // Recognize image 
    var result = await Tesseract.RecognizeTextAsync(path);

    // For this example I reset engine configuration, because same Object is used in other examples
    Tesseract.EngineConfiguration = null;

    // Show output (Not important)
    ShowOutput("FromPath, Configured", result);

}

from tesseractocrmaui.

Related Issues (11)

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.