Norwegian OCR in C# and .NET
IronOCR jest komponentem oprogramowania C#, który pozwala programistom .NET na odczytywanie tekstu z obrazów i dokumentów PDF w 126 językach, w tym w norweskim.
Jest to zaawansowany fork Tesseracta, zbudowany wyłącznie dla deweloperów .NET i regularnie przewyższający inne silniki Tesseract pod względem szybkości i dokładności.
Zawartość IronOcr.Languages.Norwegian
Pakiet ten zawiera 52 języki OCR dla .NET:
- Norweski
- NorweskiBest
- NorweskiFast
Pobieranie
Norwegian Language Pack [Norsk]
Instalacja
Pierwszą rzeczą, którą musimy zrobić, jest zainstalowanie naszego pakietu OCR Norwegian do projektu .NET.
Przykład kodu
Ten przykład kodu C# odczytuje tekst norweski z obrazu lub dokumentu PDF.
// Make sure to install the Norwegian language package:
// PM> Install-Package IronOcr.Languages.Norwegian
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Norwegian
Ocr.Language = OcrLanguage.Norwegian;
// Define the input source as an image file
using (var Input = new OcrInput(@"images\Norwegian.png"))
{
// Perform OCR to read the text from the image
var Result = Ocr.Read(Input);
// Store the extracted text in a variable
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}' Make sure to install the Norwegian language package:
' PM> Install-Package IronOcr.Languages.Norwegian
Imports IronOcr
Dim Ocr = New IronTesseract()
' Set the OCR language to Norwegian
Ocr.Language = OcrLanguage.Norwegian
' Define the input source as an image file
Using Input = New OcrInput("images\Norwegian.png")
' Perform OCR to read the text from the image
Dim Result = Ocr.Read(Input)
' Store the extracted text in a variable
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using' Make sure to install the Norwegian language package:
' PM> Install-Package IronOcr.Languages.Norwegian
Imports IronOcr
Dim Ocr = New IronTesseract()
' Set the OCR language to Norwegian
Ocr.Language = OcrLanguage.Norwegian
' Define the input source as an image file
Using Input = New OcrInput("images\Norwegian.png")
' Perform OCR to read the text from the image
Dim Result = Ocr.Read(Input)
' Store the extracted text in a variable
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using- Ten kod inicjalizuje silnik OCR, ustawia język na norweski, odczytuje tekst z obrazu, a następnie wyprowadza rozpoznany tekst.
- Upewnij się, że pakiet IronOCR i pakiet języka norweskiego są zainstalowane w twoim projekcie .NET, aby pomyślnie uruchomić ten przykład.
Curtis Chau posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podręczników.