C#һәм .NET

Бу документның башка версияләре:

IronOCR - C# программа компоненты .NET кодераторларына рәсемнәрдән һәм PDF документларыннан текстны 126 телдә укырга мөмкинлек бирә, шул исәптән татар.

Бу Тессерактның алдынгы челтәре, .NET ясаучылар өчен генә төзелгән һәм тизлек һәм төгәллек өчен башка Tesseract двигательләреннән даими узып бара.

IronOcr.Languages.Tatar эчтәлеге

Бу пакетта .NET өчен 40 OCR теле бар:

  • Татар
  • TatarBest
  • Tatarәр сүзнең

Йөкләү

Татар Pack [татар теле Себер теле]
* Download as Почта
* Install with NuGet

Урнаштыру

Беренче эш - безнең .NET проектына безнең Татар OCR пакетын урнаштыру.

PM> Install-Package IronOCR.Languages.Tatar

Код үрнәге

Бу C# код мисалы Рәсем яки PDF документыннан татар текстын укый.

// PM> Install-Package IronOCR.Languages.Tatar
using IronOcr;

// Create an OCR engine instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the input image
using (var Input = new OcrInput(@"images\Tatar.png"))
{
    // Process the input image and extract text
    var Result = Ocr.Read(Input);

    // Store the recognized text in a variable
    var AllText = Result.Text;
}
// PM> Install-Package IronOCR.Languages.Tatar
using IronOcr;

// Create an OCR engine instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the input image
using (var Input = new OcrInput(@"images\Tatar.png"))
{
    // Process the input image and extract text
    var Result = Ocr.Read(Input);

    // Store the recognized text in a variable
    var AllText = Result.Text;
}
' PM> Install-Package IronOCR.Languages.Tatar
Imports IronOcr

' Create an OCR engine instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load the input image
Using Input = New OcrInput("images\Tatar.png")
	' Process the input image and extract text
	Dim Result = Ocr.Read(Input)

	' Store the recognized text in a variable
	Dim AllText = Result.Text
End Using
$vbLabelText   $csharpLabel

Нигә IronOCR сайларга?

Тимер OCR - урнаштыру җиңел, тулы һәм яхшы документлаштырылган .NET программа китапханәсе.

Тышкы веб-хезмәтләрне, дәвамлы түләүләрне кулланмыйча яки интернет аша яшерен документлар җибәрмичә, 99,8% + OCR төгәллегенә ирешү өчен IronOCR-ны сайлагыз.

Ни өчен C# уйлап табучылар Vanilla Tesseract өстендә IronOCR сайлыйлар:

  • Бер DLL яки NuGet итеп урнаштырыгыз
  • Тессеракт өчен 5, 4 һәм 3 двигательләр керә.
  • Төгәллек 99,8% регуляр Тессеракттан күпкә өстен.
  • Ялкынлы тизлек һәм күп уку
  • MVC, WebApp, Desktop, Console & Server кушымтасы туры килә
  • Эшләргә Exes яки C ++ коды юк
  • Тулы PDF OCR ярдәме
  • OCR теләсә нинди Рәсем файлын яки PDFны башкару өчен
  • Тулы .NET Core, Standard һәм FrameWork ярдәме
  • Windows, Mac, Linux, Azure, Docker, Lambda, AWS урнаштырыгыз
  • Штрих-кодларны һәм QR кодларны укыгыз
  • XHTML буенча OCR экспортлагыз
  • Эзләнә торган PDF документларына OCR экспортлагыз
  • Күпкырлы ярдәм
  • 126 халыкара тел барысы да NuGet яки OcrData файллары белән идарә ителә
  • Рәсемнәрне, координаталарны, статистика һәм шрифтларны чыгару. Текст кына түгел.
  • Tesseract OCR-ны коммерция һәм милек кушымталары эчендә тарату өчен кулланырга мөмкин.

Тимер OCR реаль дөнья образлары һәм камил булмаган документлар белән эшләгәндә балкып тора, фотосурәтләр, яки санлы тавыш яки кимчелекләр булырга мөмкин түбән резолюция сканерлары.

.NET платформасы өчен бүтән бушлай OCR китапханәләре, башка .NET tesseract APIs һәм веб-хезмәтләр бу реаль дөнья куллану очракларында бик яхшы эшләми.

Tesseract 5 белән OCR - C# кодлаштыруны башлау

Түбәндәге код үрнәге C# яки VB .NET ярдәмендә рәсемнән текстны уку ничек җиңел икәнен күрсәтә.

OneLiner

// This example demonstrates reading text from an image in one line
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
// This example demonstrates reading text from an image in one line
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
' This example demonstrates reading text from an image in one line
Dim Text As String = (New IronTesseract()).Read("img\Screenshot.png").Text
$vbLabelText   $csharpLabel

Сәлам Дөнья

// PM> Install-Package IronOCR.Languages.Tatar
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Create input for the OCR process
using (var Input = new OcrInput())
{
    // Add images to the input for OCR processing
    Input.AddImage("images/sample.jpeg");
    //... сез теләсә нинди рәсемнәр өсти аласыз

    // Execute OCR and retrieve the result
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
// PM> Install-Package IronOCR.Languages.Tatar
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Create input for the OCR process
using (var Input = new OcrInput())
{
    // Add images to the input for OCR processing
    Input.AddImage("images/sample.jpeg");
    //... сез теләсә нинди рәсемнәр өсти аласыз

    // Execute OCR and retrieve the result
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
' PM> Install-Package IronOCR.Languages.Tatar
Imports IronOcr

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Create input for the OCR process
Using Input = New OcrInput()
	' Add images to the input for OCR processing
	Input.AddImage("images/sample.jpeg")
	'... сез теләсә нинди рәсемнәр өсти аласыз

	' Execute OCR and retrieve the result
	Dim Result = Ocr.Read(Input)
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

C# PDF OCR

Шул ук ысул теләсә нинди PDF документыннан текст алу өчен кулланылырга мөмкин.

using IronOcr;

// Create a new OCR instance
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the PDF file for OCR
using (var Input = new OcrInput())
{
    Input.AddPdf("example.pdf", "password");

    // Execute OCR on the provided PDF
    var Result = Ocr.Read(Input);

    // Output recognized text and page count
    Console.WriteLine(Result.Text);
    Console.WriteLine($"{Result.Pages.Count()} Pages");
}
using IronOcr;

// Create a new OCR instance
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the PDF file for OCR
using (var Input = new OcrInput())
{
    Input.AddPdf("example.pdf", "password");

    // Execute OCR on the provided PDF
    var Result = Ocr.Read(Input);

    // Output recognized text and page count
    Console.WriteLine(Result.Text);
    Console.WriteLine($"{Result.Pages.Count()} Pages");
}
Imports IronOcr

' Create a new OCR instance
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load the PDF file for OCR
Using Input = New OcrInput()
	Input.AddPdf("example.pdf", "password")

	' Execute OCR on the provided PDF
	Dim Result = Ocr.Read(Input)

	' Output recognized text and page count
	Console.WriteLine(Result.Text)
	Console.WriteLine($"{Result.Pages.Count()} Pages")
End Using
$vbLabelText   $csharpLabel

MultiPage TIFF өчен OCR

OCR уку TIFF файл форматы, берничә бит документларын кертеп. TIFF шулай ук эзләнә торган текст белән турыдан-туры PDF файлына әверелергә мөмкин.

using IronOcr;

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load multi-frame TIFF file
using (var Input = new OcrInput())
{
    Input.AddMultiFrameTiff("multi-frame.tiff");

    // Read text from the input
    var Result = Ocr.Read(Input);

    // Print the recognized text to the console
    Console.WriteLine(Result.Text);
}
using IronOcr;

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load multi-frame TIFF file
using (var Input = new OcrInput())
{
    Input.AddMultiFrameTiff("multi-frame.tiff");

    // Read text from the input
    var Result = Ocr.Read(Input);

    // Print the recognized text to the console
    Console.WriteLine(Result.Text);
}
Imports IronOcr

' Create a new OCR instance and set language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load multi-frame TIFF file
Using Input = New OcrInput()
	Input.AddMultiFrameTiff("multi-frame.tiff")

	' Read text from the input
	Dim Result = Ocr.Read(Input)

	' Print the recognized text to the console
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

Штрих-кодлар һәм QR

Тимер OCRның уникаль үзенчәлеге - ул текстны сканерләгәндә документлардан штрих-кодларны һәм QR кодларны укый ала. OcrResult.OcrBarcode класс очраклары уйлап табучыга һәр сканерланган штрих-код турында тулы мәгълүмат бирә.

// Import IronOcr namespace
using IronOcr;

// Initialize the OCR engine and enable barcode reading
var Ocr = new IronTesseract();
Ocr.Configuration.ReadBarCodes = true;

// Create input for OCR
using (var Input = new OcrInput())
{
    // Add image containing barcodes
    Input.AddImage("img/Barcode.png");

    // Perform OCR and retrieve results
    var Result = Ocr.Read(Input);
    foreach (var Barcode in Result.Barcodes)
    {
        // Print the value of each detected barcode
        Console.WriteLine(Barcode.Value);
        // Other barcode properties such as type and location can also be accessed
    }
}
// Import IronOcr namespace
using IronOcr;

// Initialize the OCR engine and enable barcode reading
var Ocr = new IronTesseract();
Ocr.Configuration.ReadBarCodes = true;

// Create input for OCR
using (var Input = new OcrInput())
{
    // Add image containing barcodes
    Input.AddImage("img/Barcode.png");

    // Perform OCR and retrieve results
    var Result = Ocr.Read(Input);
    foreach (var Barcode in Result.Barcodes)
    {
        // Print the value of each detected barcode
        Console.WriteLine(Barcode.Value);
        // Other barcode properties such as type and location can also be accessed
    }
}
' Import IronOcr namespace
Imports IronOcr

' Initialize the OCR engine and enable barcode reading
Private Ocr = New IronTesseract()
Ocr.Configuration.ReadBarCodes = True

' Create input for OCR
Using Input = New OcrInput()
	' Add image containing barcodes
	Input.AddImage("img/Barcode.png")

	' Perform OCR and retrieve results
	Dim Result = Ocr.Read(Input)
	For Each Barcode In Result.Barcodes
		' Print the value of each detected barcode
		Console.WriteLine(Barcode.Value)
		' Other barcode properties such as type and location can also be accessed
	Next Barcode
End Using
$vbLabelText   $csharpLabel

Рәсемнәрнең аерым өлкәләрендә OCR

Тимер OCR-ның барлык сканерлау һәм уку ысуллары битнең яки битнең кайсы өлешен текст укырга теләгәнебезне күрсәтә ала. Стандартланган формаларны караганда бу бик файдалы, бик күп вакытны саклап калырга һәм эффективлыкны күтәрергә мөмкин.

Уңыш районнары куллану өчен, без бер система Белешмә өстәргә кирәк булачак System.Drawing без куллана ала дип System.Drawing.Rectangle объект.

using IronOcr;
using System.Drawing;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the target image and specify the area of interest
using (var Input = new OcrInput())
{
    var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
    // Load the specified area from the image for OCR processing
    Input.Add("document.png", ContentArea);

    // Execute OCR within the specified region
    var Result = Ocr.Read(Input);

    // Print the recognized text from the specified region
    Console.WriteLine(Result.Text);
}
using IronOcr;
using System.Drawing;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load the target image and specify the area of interest
using (var Input = new OcrInput())
{
    var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
    // Load the specified area from the image for OCR processing
    Input.Add("document.png", ContentArea);

    // Execute OCR within the specified region
    var Result = Ocr.Read(Input);

    // Print the recognized text from the specified region
    Console.WriteLine(Result.Text);
}
Imports IronOcr
Imports System.Drawing

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load the target image and specify the area of interest
Using Input = New OcrInput()
	Dim ContentArea = New Rectangle() With {
		.X = 215,
		.Y = 1250,
		.Height = 280,
		.Width = 1335
	}
	' Load the specified area from the image for OCR processing
	Input.Add("document.png", ContentArea)

	' Execute OCR within the specified region
	Dim Result = Ocr.Read(Input)

	' Print the recognized text from the specified region
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

Сыйфатсыз сканерлар өчен OCR

Тимер OCR OcrInput классы гадәти Tesseract укый алмаган сканерларны төзәтә ала.

using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load low quality image for OCR
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
    // Apply filters to enhance the image quality
    Input.DeNoise(); // Reduce noise
    Input.Deskew();  // Correct skew

    // Execute OCR and display results
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load low quality image for OCR
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
    // Apply filters to enhance the image quality
    Input.DeNoise(); // Reduce noise
    Input.Deskew();  // Correct skew

    // Execute OCR and display results
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
Imports IronOcr

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load low quality image for OCR
Using Input = New OcrInput("img\Potter.LowQuality.tiff")
	' Apply filters to enhance the image quality
	Input.DeNoise() ' Reduce noise
	Input.Deskew() ' Correct skew

	' Execute OCR and display results
	Dim Result = Ocr.Read(Input)
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

OCR нәтиҗәләрен эзләү PDF итеп экспортлау

Күчереп язылган текст сызыклары белән PDF-ка рәсем. Эзләү системалары һәм мәгълүмат базалары белән индексацияләнергә мөмкин.

using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load images for OCR and PDF export
using (var Input = new OcrInput())
{
    Input.Title = "Quarterly Report";
    Input.AddImage("image1.jpeg");
    Input.AddImage("image2.png");
    Input.AddImage("image3.gif");

    // Execute OCR and save results to a searchable PDF
    var Result = Ocr.Read(Input);
    Result.SaveAsSearchablePdf("searchable.pdf");
}
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load images for OCR and PDF export
using (var Input = new OcrInput())
{
    Input.Title = "Quarterly Report";
    Input.AddImage("image1.jpeg");
    Input.AddImage("image2.png");
    Input.AddImage("image3.gif");

    // Execute OCR and save results to a searchable PDF
    var Result = Ocr.Read(Input);
    Result.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load images for OCR and PDF export
Using Input = New OcrInput()
	Input.Title = "Quarterly Report"
	Input.AddImage("image1.jpeg")
	Input.AddImage("image2.png")
	Input.AddImage("image3.gif")

	' Execute OCR and save results to a searchable PDF
	Dim Result = Ocr.Read(Input)
	Result.SaveAsSearchablePdf("searchable.pdf")
End Using
$vbLabelText   $csharpLabel

Эзләнә торган PDF конверсиясенә TIFF

TIFF документын (яки теләсә нинди рәсем файллары төркемен) турыдан-туры эзләнә торган PDFка күчерегез, аны интернет, вебсайт һәм google эзләү системалары индексацияли ала.

using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Convert multi-frame TIFF to a searchable PDF
using (var Input = new OcrInput())
{
    Input.AddMultiFrameTiff("example.tiff");

    // Execute OCR and save results as a searchable PDF
    var Result = Ocr.Read(Input);
    Result.SaveAsSearchablePdf("searchable.pdf");
}
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Convert multi-frame TIFF to a searchable PDF
using (var Input = new OcrInput())
{
    Input.AddMultiFrameTiff("example.tiff");

    // Execute OCR and save results as a searchable PDF
    var Result = Ocr.Read(Input);
    Result.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Convert multi-frame TIFF to a searchable PDF
Using Input = New OcrInput()
	Input.AddMultiFrameTiff("example.tiff")

	' Execute OCR and save results as a searchable PDF
	Dim Result = Ocr.Read(Input)
	Result.SaveAsSearchablePdf("searchable.pdf")
End Using
$vbLabelText   $csharpLabel

OCR нәтиҗәләрен HTML итеп экспортлагыз

OCR рәсеме XHTML конверсиясенә.

using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load image and set OCR options for HTML export
using (var Input = new OcrInput())
{
    Input.Title = "Html Title";
    Input.AddImage("image1.jpeg");

    // Execute OCR and save results as an HTML file
    var Result = Ocr.Read(Input);
    Result.SaveAsHocrFile("results.html");
}
using IronOcr;

// Create a new OCR instance and set the language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load image and set OCR options for HTML export
using (var Input = new OcrInput())
{
    Input.Title = "Html Title";
    Input.AddImage("image1.jpeg");

    // Execute OCR and save results as an HTML file
    var Result = Ocr.Read(Input);
    Result.SaveAsHocrFile("results.html");
}
Imports IronOcr

' Create a new OCR instance and set the language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load image and set OCR options for HTML export
Using Input = New OcrInput()
	Input.Title = "Html Title"
	Input.AddImage("image1.jpeg")

	' Execute OCR and save results as an HTML file
	Dim Result = Ocr.Read(Input)
	Result.SaveAsHocrFile("results.html")
End Using
$vbLabelText   $csharpLabel

OCR рәсемне арттыру фильтрлары

IronOCR OCR эшчәнлеген яхшырту өчен OcrInput объектлары өчен уникаль фильтрлар тәкъдим итә.

Рәсемне арттыру коды мисалы

Яхшырак, тизрәк OCR нәтиҗәләрен чыгару өчен OCR кертү рәсемнәрен югары сыйфатлы итә.

using IronOcr;

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load a low-quality image for OCR
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
    // Apply image enhancement filters
    Input.DeNoise(); // Reduce noise
    Input.Deskew();  // Correct skew

    // Execute OCR and display the recognized text
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
using IronOcr;

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Load a low-quality image for OCR
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
    // Apply image enhancement filters
    Input.DeNoise(); // Reduce noise
    Input.Deskew();  // Correct skew

    // Execute OCR and display the recognized text
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
Imports IronOcr

' Create a new OCR instance and set language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Load a low-quality image for OCR
Using Input = New OcrInput("LowQuality.jpeg")
	' Apply image enhancement filters
	Input.DeNoise() ' Reduce noise
	Input.Deskew() ' Correct skew

	' Execute OCR and display the recognized text
	Dim Result = Ocr.Read(Input)
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

OCR Рәсем Фильтрлары исемлеге

IronOCR эчендә төзелгән OCR җитештерүчәнлеген арттыру өчен кертү фильтрлары:

  • OcrInput.Rotate(double degrees) - Rotate images clockwise by a specified number of degrees. Use negative numbers for counter-clockwise rotation.
  • OcrInput.Binarize() - Converts each pixel in the image to black or white. This filter can improve OCR outcomes when there is very low contrast between text and background.
  • OcrInput.ToGrayScale() - Converts each pixel into a shade of gray. This may not improve OCR accuracy but can improve processing speed.
  • OcrInput.Contrast() - Automatically enhances image contrast. This filter often improves both the speed and accuracy of OCR on low-contrast documents.
  • OcrInput.DeNoise() - Removes digital noise. Use this filter only when noise is present.
  • OcrInput.Invert() - Inverts all colors. For example, black becomes white, and white becomes black.
  • OcrInput.Dilate() - Advanced morphology operation. Dilation adds pixels to the boundaries of objects in an image. Opposite of erosion.
  • OcrInput.Erode() - Advanced morphology operation. Erosion removes pixels on object boundaries.
  • OcrInput.Deskew() - Corrects image rotation so that it is upright and orthogonal. This is highly beneficial for OCR as Tesseract's tolerance for skew is low, around 5 degrees.
  • OcrInput.DeepCleanBackgroundNoise() - Severe background noise removal. Apply this filter when extreme document background noise is known; it can reduce OCR accuracy on clean documents and is CPU intensive.
  • OcrInput.EnhanceResolution - Augments resolution of low-quality images. Often unnecessary because `OcrInput.MinimumDPI` and `OcrInput.TargetDPI` will automatically detect and correct low-resolution inputs.

CleanBackgroundNoise - This setting requires significant computation time; however, it allows the library to automatically clean up digital noise, paper artifacts, and other imperfections, making it readable by other OCR libraries.

EnhanceContrast - This configuration automatically increases the contrast between text and its background, increasing OCR accuracy and typically boosting performance and speed.

EnhanceResolution - This setting will detect low-resolution images (below 275 dpi) and upscale them so they are more readable by the OCR library, shortening overall OCR operation time for low-quality inputs.

Language - Iron OCR supports 22 international language packs, allowing the selection of one or more languages to use in the OCR operation.

Strategy - Iron OCR supports two strategies: a faster, less accurate scan, and a more advanced strategy using artificial intelligence models to automatically improve text accuracy.

ColorSpace - Determines whether OCR uses grayscale or color. Grayscale is usually the best choice, but full color may yield better results when there is similar colored text or background in full-text color space.

DetectWhiteTextOnDarkBackgrounds - By default, OCR libraries will recognize black text on white backgrounds. This configuration allows Iron OCR to automatically detect and read white text on black backgrounds.

InputImageType - Provides guidance to the OCR library as to whether the input is expected to be a full document or a snippet like a screenshot.

RotateAndStraighten - An advanced setting that allows Iron OCR to not just rotate but correct perspectives found in photographs of text documents.

ReadBarcodes - This feature allows Iron OCR to automatically read barcodes and QR codes as it reads text, adding little additional processing time.

ColorDepth - Determines the bit depth used per pixel by the OCR library for color, which may increase OCR quality but also the processing time required to complete an OCR operation.

126 Тел пакетлары

Тимер OCR тел пакетлары аша 126 халыкара телгә ярдәм итә, алар DLL буларак таратыла , бу сайттан йөкләнә ала, яки NuGet Package менеджерыннан.

Телләргә немец, француз, инглиз, кытай, япон һәм башкалар керә. МРЗ паспорты, MICR тикшерүләре, финанс мәгълүматлары, лицензия тәлинкәләре һәм башкалар өчен махсус тел пакетлары бар. Сез шулай ук теләсә нинди ".traineddata" файлын куллана аласыз - үзегез ясаган файлларны да кертеп.

Тел мисалы

Башка OCR телләрен куллану.

// using IronOcr;
// PM> Install IronOcr.Languages.Arabic

// Create an OCR instance and set the language to Arabic
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Arabic;

using (var Input = new OcrInput())
{
    // Add an image for OCR processing
    Input.AddImage("img/arabic.gif");

    // Execute OCR on the input
    var Result = Ocr.Read(Input);

    // Save the recognized text to a file
    Result.SaveAsTextFile("arabic.txt");
}
// using IronOcr;
// PM> Install IronOcr.Languages.Arabic

// Create an OCR instance and set the language to Arabic
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Arabic;

using (var Input = new OcrInput())
{
    // Add an image for OCR processing
    Input.AddImage("img/arabic.gif");

    // Execute OCR on the input
    var Result = Ocr.Read(Input);

    // Save the recognized text to a file
    Result.SaveAsTextFile("arabic.txt");
}
' using IronOcr;
' PM> Install IronOcr.Languages.Arabic

' Create an OCR instance and set the language to Arabic
Dim Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Arabic

Using Input = New OcrInput()
	' Add an image for OCR processing
	Input.AddImage("img/arabic.gif")

	' Execute OCR on the input
	Dim Result = Ocr.Read(Input)

	' Save the recognized text to a file
	Result.SaveAsTextFile("arabic.txt")
End Using
$vbLabelText   $csharpLabel

Күп телләр мисалы

ОКРга берьюлы берничә тел кулланып та мөмкин. Бу чыннан да icникод документларында инглиз теленең мета-мәгълүматларын һәм урлларын алырга ярдәм итә ала.

// using IronOcr;
// PM> Install IronOcr.Languages.ChineseSimplified

// Create a new OCR instance
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.ChineseSimplified;
Ocr.AddSecondaryLanguage(OcrLanguage.Tatar);

// Load a multi-language PDF
using (var Input = new OcrInput())
{
    Input.Add("multi-language.pdf");

    // Execute OCR and save results
    var Result = Ocr.Read(Input);
    Result.SaveAsTextFile("results.txt");
}
// using IronOcr;
// PM> Install IronOcr.Languages.ChineseSimplified

// Create a new OCR instance
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.ChineseSimplified;
Ocr.AddSecondaryLanguage(OcrLanguage.Tatar);

// Load a multi-language PDF
using (var Input = new OcrInput())
{
    Input.Add("multi-language.pdf");

    // Execute OCR and save results
    var Result = Ocr.Read(Input);
    Result.SaveAsTextFile("results.txt");
}
' using IronOcr;
' PM> Install IronOcr.Languages.ChineseSimplified

' Create a new OCR instance
Dim Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.ChineseSimplified
Ocr.AddSecondaryLanguage(OcrLanguage.Tatar)

' Load a multi-language PDF
Using Input = New OcrInput()
	Input.Add("multi-language.pdf")

	' Execute OCR and save results
	Dim Result = Ocr.Read(Input)
	Result.SaveAsTextFile("results.txt")
End Using
$vbLabelText   $csharpLabel

OCR нәтиҗәләре объектлары

Тимер OCR һәр OCR операциясе өчен OCR нәтиҗә объектын кайтара. Гадәттә, уйлап табучылар бу объектның текст мөлкәтен тексттан сканерлау өчен кулланалар. Ләкин, OCR нәтиҗәләре DOM моннан күпкә алгарак.

using IronOcr;
using System.Drawing; // Add System.Drawing reference

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Configure OCR engine mode and enable barcode reading
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
Ocr.Configuration.ReadBarCodes = true;

using (var Input = new OcrInput(@"images\sample.tiff"))
{
    // Execute OCR and retrieve OCR result
    OcrResult Result = Ocr.Read(Input);

    // Access detailed information from the OCR result
    var Pages = Result.Pages;
    var Words = Pages[0].Words;
    var Barcodes = Result.Barcodes;

    // Explore the API for additional details:
    // - Pages, Blocks, Paragraphs, Lines, Words, Symbols
    // - Image export, font coordinates, statistics
}
using IronOcr;
using System.Drawing; // Add System.Drawing reference

// Create a new OCR instance and set language to Tatar
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Tatar;

// Configure OCR engine mode and enable barcode reading
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
Ocr.Configuration.ReadBarCodes = true;

using (var Input = new OcrInput(@"images\sample.tiff"))
{
    // Execute OCR and retrieve OCR result
    OcrResult Result = Ocr.Read(Input);

    // Access detailed information from the OCR result
    var Pages = Result.Pages;
    var Words = Pages[0].Words;
    var Barcodes = Result.Barcodes;

    // Explore the API for additional details:
    // - Pages, Blocks, Paragraphs, Lines, Words, Symbols
    // - Image export, font coordinates, statistics
}
Imports IronOcr
Imports System.Drawing ' Add System.Drawing reference

' Create a new OCR instance and set language to Tatar
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Tatar

' Configure OCR engine mode and enable barcode reading
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm
Ocr.Configuration.ReadBarCodes = True

Using Input = New OcrInput("images\sample.tiff")
	' Execute OCR and retrieve OCR result
	Dim Result As OcrResult = Ocr.Read(Input)

	' Access detailed information from the OCR result
	Dim Pages = Result.Pages
	Dim Words = Pages(0).Words
	Dim Barcodes = Result.Barcodes

	' Explore the API for additional details:
	' - Pages, Blocks, Paragraphs, Lines, Words, Symbols
	' - Image export, font coordinates, statistics
End Using
$vbLabelText   $csharpLabel

Спектакль

IronOCR рамкадан эшли, көйләү көйләрен башкарырга яки кертү рәсемнәрен бик үзгәртергә кирәкми.

Тизлек янып тора: IronOcr.2020 + 10 тапкырга тизрәк һәм алдагы корылмаларга караганда 250% азрак хаталар ясый.

Тулырак

OCR турында C #, VB, F # яки бүтән .NET телендә күбрәк белү өчен, зинһар өчен, безнең җәмгыять дәреслекләрен укыгыз, алар тимер OCR куллануның реаль дөнья мисалларын китерәләр һәм ничек яхшырак файдалану нюансларын күрсәтә алалар бу китапханә.

.NET ясаучылар өчен тулы объект сылтамасы да бар.