Wyniki OCR
Uzyskaj więcej niż tylko tekst. Nasze API dostarcza strukturalne dane, w tym współrzędne, poziomy pewności i pełną hierarchię dokumentu (strony, wiersze, słowa).
Wyniki danych
Teksty
IronOCR zwraca wyniki tekstu dla akapitów, wierszy, słów i znaków jako obiekty strukturalne i ciągi znaków, umożliwiając programistom szybki dostęp do danych i ich manipulację.
using IronOcr;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
var pages = new int[] { 1, 2 };
ocrInput.LoadImageFrames("example.tiff", pages);
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
foreach (var page in ocrResult.Pages)
{
// Page text
string PageText = page.Text;
}Imports IronOcr
Dim ocrTesseract As New IronTesseract()
Using ocrInput As New OcrInput()
Dim pages As Integer() = {1, 2}
ocrInput.LoadImageFrames("example.tiff", pages)
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
For Each page In ocrResult.Pages
' Page text
Dim PageText As String = page.Text
Next
End UsingLokalizacja tekstów OCR
Uzyskaj precyzyjne współrzędne X/Y i wymiary ramki okalającej dla każdego akapitu, wiersza, słowa i znaku, umożliwiając podświetlanie tekstu, OCR strefowe i walidację danych.
Ucz się, jak:Wyodrębnić wyniki czytania w .NET C#using IronOcr;
using IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Retrieve list of detected paragraphs
Paragraph[] paragraphs = ocrResult.Paragraphs;
// Output Text location (X,Y) of the first paragraph
Console.WriteLine($"X: {paragraphs[0].X}");
Console.WriteLine($"Y: {paragraphs[0].Y}");Imports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput As New OcrImageInput("sample.jpg")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Retrieve list of detected paragraphs
Dim paragraphs() As Paragraph = ocrResult.Paragraphs
' Output Text location (X,Y) of the first paragraph
Console.WriteLine($"X: {paragraphs(0).X}")
Console.WriteLine($"Y: {paragraphs(0).Y}")
End UsingPewność wyniku OCR
Otrzymaj punktację pewności dla wyodrębnionych tekstów. Programistycznie określ niską pewność wyników do ludzkiej weryfikacji, aby zbudować bardziej niezawodne przepływy pracy automatyzacji.
Ucz się, jak:Uzyskać pewność czytania w .NET C#using IronOcr;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
// Load image from file
ocrInput.LoadImage("sameple.png");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
// Check Confidence level
Console.WriteLine($"Confidence: {ocrResult.Confidence}%");Imports IronOcr
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
' Load image from file
ocrInput.LoadImage("sameple.png")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
' Check Confidence level
Console.WriteLine($"Confidence: {ocrResult.Confidence}%")
End UsingObrazy elementów OCR
Oprócz tekstu, eksportuj wizualne elementy wykryte z OCR z dokumentu wejściowego jako osobne pliki obrazów, przydatne do archiwizacji lub przetwarzania nietekstowych danych.
Ucz się, jak:Wyodrębnić wyniki czytania w .NET C#using IronOcr;
using IronSoftware.Drawing;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadImage("sample.png");
var ocrResult = ocrTesseract.Read(ocrInput);
foreach (var page in ocrResult.Pages)
{
foreach (var word in page.Words)
{
word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png);
}
}Imports IronOcr
Imports IronSoftware.Drawing
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
ocrInput.LoadImage("sample.png")
Dim ocrResult = ocrTesseract.Read(ocrInput)
For Each page In ocrResult.Pages
For Each word In page.Words
word.ToBitmap(ocrInput).SaveAs($"page{page.PageNumber}_word{word.WordNumber}.png", AnyBitmap.ImageFormat.Png)
Next
Next
End Using
Rodzaje wyników
Tekst
Uzyskaj dostęp do wyników OCR przez strukturalne, hierarchiczne API. Łatwo nawiguj od dużych akapitów do poszczególnych znaków, dając Ci szczegółową kontrolę nad wyodrębnionym tekstem i jego metadanymi.
Ucz się, jak:Wyodrębnić wyniki czytania w .NET C#using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Output the first detected paragraph text
Console.WriteLine($"Text: {ocrResult.Paragraphs[0].Text}");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput As New OcrImageInput("sample.jpg")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Output the first detected paragraph text
Console.WriteLine($"Text: {ocrResult.Paragraphs(0).Text}")
End UsingPrzeszukiwalne PDF-y
Konwertuj dowolny zeskanowany dokument lub obraz w w pełni przeszukiwalny plik PDF. Oryginalny układ jest zachowany, ale cały tekst staje się wybieralny, kopiowalny i odkrywalny.
Ucz się, jak:Zapisz wyniki jako przeszukiwalny PDFusing IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable render as searchable PDF
ocrTesseract.Configuration.RenderSearchablePdf = true;
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Export as searchable PDF
ocrResult.SaveAsSearchablePdf("searchablePdf.pdf");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable render as searchable PDF
ocrTesseract.Configuration.RenderSearchablePdf = True
' Add image
Using imageInput As New OcrImageInput("sample.tiff")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Export as searchable PDF
ocrResult.SaveAsSearchablePdf("searchablePdf.pdf")
End UsinghOCR
Eksportuj wyniki w formacie hOCR, standardzie opartym na HTML, który dostarcza bogate metadane, w tym informacje tekstowe, układ i współrzędne dla każdego słowa, idealne do zaawansowanej analizy dokumentów.
Ucz się, jak:Zapisz wyniki jako hOCR w pliku HTMLusing IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable render as hOCR
ocrTesseract.Configuration.RenderHocr = true;
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
imageInput.Title = "Html Title";
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Export as HTML
ocrResult.SaveAsHocrFile("result.html");Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable render as hOCR
ocrTesseract.Configuration.RenderHocr = True
' Add image
Using imageInput As New OcrImageInput("sample.tiff")
imageInput.Title = "Html Title"
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Export as HTML
ocrResult.SaveAsHocrFile("result.html")
End UsingPodświetlenie tekstów jako obrazy
Dla debugowania i weryfikacji, wygeneruj obraz oryginalnego dokumentu z podświetlonym całym rozpoznanym tekstem. To zapewnia szybkie sprawdzenie wizualne dokładności silnika OCR i lokalizacji tekstu.
Ucz się, jak:C# Podświetl teksty dla debugowaniausing IronOcr;
IronTesseract ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadPdf("sample.pdf");
ocrInput.HighlightTextAndSaveAsImages(ocrTesseract, "highlight_page_", ResultHighlightType.Paragraph);Imports IronOcr
Dim ocrTesseract As New IronTesseract()
Using ocrInput As New OcrInput()
ocrInput.LoadPdf("sample.pdf")
ocrInput.HighlightTextAndSaveAsImages(ocrTesseract, "highlight_page_", ResultHighlightType.Paragraph)
End UsingWartości kodów kreskowych i kodów QR
Wyodrębnij zdekodowane wartości ciągów znaków z dowolnych kodów kreskowych lub kodów QR znalezionych w dokumencie. API dostarcza te dane wraz z wynikami tekstu dla kompletnego rozwiązania do wyodrębniania danych.
Ucz się, jak:Wyodrębnić wyniki czytania w .NET C#using IronOcr;
using IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Enable barcodes detection
ocrTesseract.Configuration.ReadBarCodes = true;
// Load PDF file
using OcrInput ocrInput = new OcrInput();
ocrInput.LoadPdf("sample.pdf");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
// Output Barcode value
Console.WriteLine(ocrResult.Barcodes[0].Value);Imports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Enable barcodes detection
ocrTesseract.Configuration.ReadBarCodes = True
' Load PDF file
Using ocrInput As New OcrInput()
ocrInput.LoadPdf("sample.pdf")
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
' Output Barcode value
Console.WriteLine(ocrResult.Barcodes(0).Value)
End UsingGotowy, aby rozpocząć?
Nuget Downloads 6,236,385|Wersja:2026.9właśnie wydany