Skip to content

Provides easier access to Google ML Kits Text Recognition v2 API for .NET MAUI.

License

Notifications You must be signed in to change notification settings

Jake-Derrick/MLKit.Maui.TextRecognition

Repository files navigation

MLKit.Maui.TextRecognition

Provides easier access to Google ML Kit Text Recognition v2 API for .NET MAUI.

TextRecognitionEx

How to use it?

  1. Install the NuGet package
Install-Package MLKit.Maui.TextRecognition
  1. Initialize the Text Recognition Service in MauiProgram.cs.
var builder = MauiApp.CreateBuilder()
    .UseMauiApp<App>()

builder.Services.AddTextRecognitionService();
  1. Use the service to get the OCR/Text results from a FileResult or image byte[]
private readonly ITextRecognitionService _textRecognitionService;

public TextRecognitionExampleViewModel(ITextRecognitionService textRecognitionService)
{
    _textRecognitionService = textRecognitionService;
}

public async Task GetTextResults(FileResult imageFile)
{
    TextRecognitionResult result = await _textRecognitionService.GetTextFromImage(imageFile);
}

public async Task GetTextResults(byte[] imageBytes)
{
    TextRecognitionResult result = await _textRecognitionService.GetTextFromImage(imageBytes);
}

About

Provides easier access to Google ML Kits Text Recognition v2 API for .NET MAUI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages