IRONSOFTWAREHOME
Odczytaj zdjęcie
using IronOcr;
using IronSoftware.Drawing;
using System;

// Instantiate OCR engine
var ocr = new IronTesseract();

using var inputPhoto = new OcrInput();
inputPhoto.LoadImageFrame("ocr.tiff", 0);

// Read photo
OcrPhotoResult result = ocr.ReadPhoto(inputPhoto);

// Index number refer to region order in the page
int number = result.TextRegions[0].PageNumber;

// Extract the text in the first region
string textinregion = result.TextRegions[0].TextInRegion;

//Extract the co-ordinates of the first text region
Rectangle region = result.TextRegions[0].Region;

var output = $"Text in First Region: {textinregion}\n"
             + $"Text Region:\n"
             + $"Starting X: {region.X}\n"
             + $"Starting Y: {region.Y}\n"
             + $"Region Width: {region.Width}\n"
             + $"Region Height: {region.Height}\n"
             + $"Result Confidence: {result.Confidence}\n\n"
             + $"Full Scnned Photo Text: {result.Text}";

Console.WriteLine(output);
Imports IronOcr
Imports IronSoftware.Drawing
Imports System

' Instantiate OCR engine
Dim ocr As New IronTesseract()

Using inputPhoto As New OcrInput()
    inputPhoto.LoadImageFrame("ocr.tiff", 0)

    ' Read photo
    Dim result As OcrPhotoResult = ocr.ReadPhoto(inputPhoto)

    ' Index number refer to region order in the page
    Dim number As Integer = result.TextRegions(0).PageNumber

    ' Extract the text in the first region
    Dim textinregion As String = result.TextRegions(0).TextInRegion

    'Extract the co-ordinates of the first text region
    Dim region As Rectangle = result.TextRegions(0).Region

    Dim output As String = $"Text in First Region: {textinregion}" & vbCrLf &
                           $"Text Region:" & vbCrLf &
                           $"Starting X: {region.X}" & vbCrLf &
                           $"Starting Y: {region.Y}" & vbCrLf &
                           $"Region Width: {region.Width}" & vbCrLf &
                           $"Region Height: {region.Height}" & vbCrLf &
                           $"Result Confidence: {result.Confidence}" & vbCrLf & vbCrLf &
                           $"Full Scnned Photo Text: {result.Text}"

    Console.WriteLine(output)
End Using
NuGet Download
PM > Install-Package IronOcr
Odczytaj zdjęcie

Odczytaj zdjęcie

Zobacz na GitHubie

Gotowy, aby rozpocząć?

Nuget Downloads 6,262,020Wersja:2026.9właśnie wydany

Key in blue circle

Uzyskaj natychmiast swój darmowy 30-dniowy Klucz Testowy.

Your trial license will be sent to your email address

Brak ograniczeń. 100% dostępności. Bez karty kredytowej.

OR
bullet_checkedNie wymaga karty kredytowej ani tworzenia kontaBrak ograniczeń. 100% dostępności. Bez karty kredytowej.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
Zarezerwuj swoje darmowe Demo na żywo
Booking Badge

Zaufane przez miliony inżynierów na całym świecie

Logotypy klientów Iron Software
Otrzymaj swoje Konsultacja Bez Zobowiązań
Wypełnij poniższy formularz lub wyślij e-mail na sales@ironsoftware.com
Twoje dane zawsze będą utrzymywane w tajemnicy.
Zaufane przez miliony inżynierów na całym świecie
Logotypy klientów Iron Software
Otrzymaj swój darmowy Klucz Próbny na 30 dni natychmiast.
Nie wymaga karty kredytowej ani tworzenia konta