Euskal OCR C# eta .NET-en
Dokumentu honen beste bertsio batzuk:
IronOCR C# softwarearen osagaia da .NET kodetzaileek 126 hizkuntzatako irudien eta PDF dokumentuen testua irakurtzea 126 hizkuntzatan, euskara barne.
Tesseract-en sardexka aurreratua da, .NET garatzaileentzat soilik eraikia eta aldian-aldian beste Tesseract motorrak gainditzen ditu abiadura eta zehaztasunagatik.
IronOcr.Hizkuntzak.Euskara-ren edukia
Pakete honek .NETerako 43 OCR hizkuntza ditu:
- Euskara
- EuskaraBest
- BasqueFast
Deskargatu
Euskara Pack [euskara]
* Download as Zip
* Install with NuGet as https://www.nuget.org/packages/IronOcr.Languages.Basque/
Instalazioa
Egin behar dugun lehenengo gauza gure euskal OCR paketea zure .NET proiektuan instalatzea da.
PM> Install-Package IronOCR.Languages.Basque
Kodearen adibidea
C# kode adibide honek Image edo PDF dokumentu bateko euskarazko testua irakurtzen du.
// Install the Basque OCR language package for IronOcr
// PM> Install-Package IronOcr.Languages.Basque
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input from an image
using (var Input = new OcrInput(@"images\Basque.png"))
{
// Read the text from the image
var Result = Ocr.Read(Input);
// Print or process the retrieved text
var AllText = Result.Text;
}
// Install the Basque OCR language package for IronOcr
// PM> Install-Package IronOcr.Languages.Basque
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input from an image
using (var Input = new OcrInput(@"images\Basque.png"))
{
// Read the text from the image
var Result = Ocr.Read(Input);
// Print or process the retrieved text
var AllText = Result.Text;
}
' Install the Basque OCR language package for IronOcr
' PM> Install-Package IronOcr.Languages.Basque
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input from an image
Using Input = New OcrInput("images\Basque.png")
' Read the text from the image
Dim Result = Ocr.Read(Input)
' Print or process the retrieved text
Dim AllText = Result.Text
End Using
Zergatik aukeratu IronOCR?
IronOCR .NET software liburutegia instalatzen erraza, osoa eta ondo dokumentatuta dago.
Aukeratu IronOCR % 99,8 + OCR zehaztasuna lortzeko kanpoko web zerbitzurik, etengabeko tasarik edo Internet bidez isilpeko dokumentuak bidali gabe.
Zergatik aukeratzen dute C# garatzaileek IronOCR Vanilla Tesseract baino?
- Instalatu DLL edo NuGet bakar gisa
- Tesseract 5, 4 eta 3 motorretarako sartzen da kutxatik kanpora.
- Zehaztasunak % 99,8k ohiko Tesseract gainditzen du.
- Blazing Speed eta MultiThreading
- MVC, WebApp, Desktop, Console & Server Application bateragarriak dira
- Ez dago Exes edo C ++ koderik lan egiteko
- PDF OCR laguntza osoa
- OCR ia edozein irudi fitxategi edo PDF egiteko
- .NET Core, Standard eta FrameWork euskarri osoa
- Inplementatu Windows, Mac, Linux, Azure, Docker, Lambda, AWS zerbitzuetan
- Irakurri barra-kodeak eta QR kodeak
- Esportatu OCR XHTML gisa
- Esportatu OCR bilatzeko PDF dokumentuetara
- Multithreading euskarria
- Nazioarteko 126 hizkuntza guztiak NuGet edo OcrData fitxategien bidez kudeatuak
- Atera irudiak, koordenatuak, estatistikak eta letra tipoak. Ez bakarrik testua.
- Tesseract OCR birbanatzeko aplikazio komertzial eta jabedunen barruan banatzeko erabil daiteke.
Burdinazko OCR distirak distira ematen du mundu errealeko irudiekin eta dokumentu inperfektuekin lan egitean, hala nola argazkiekin edo bereizmen txikiko eskanerrak, zarata digitala edo akatsak izan ditzaketenak.
.NET plataformarako doako beste OCR liburutegi batzuek .net tesseract APIak eta web zerbitzuek ez dute hain ondo funtzionatzen mundu errealeko erabilera kasu hauetan.
OCR Tesseract 5-rekin - Hasi kodeketa C#-ean
Beheko kode laginak erakusten du zein erraza den C# edo VB .NET erabiliz irudi bateko testua irakurtzea.
OneLiner
// A simple one-liner to read text from an image using IronOcr
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
// A simple one-liner to read text from an image using IronOcr
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
' A simple one-liner to read text from an image using IronOcr
Dim Text As String = (New IronTesseract()).Read("img\Screenshot.png").Text
Konfiguratu Hello World
// Install the Basque OCR language package for IronOcr
// PM> Install-Package IronOcr.Languages.Basque
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an empty OCR input
using (var Input = new OcrInput())
{
// Add an image to the OCR input
Input.AddImage("images/sample.jpeg");
// Read the text from the added image
var Result = Ocr.Read(Input);
// Print or process the retrieved text
Console.WriteLine(Result.Text);
}
// Install the Basque OCR language package for IronOcr
// PM> Install-Package IronOcr.Languages.Basque
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an empty OCR input
using (var Input = new OcrInput())
{
// Add an image to the OCR input
Input.AddImage("images/sample.jpeg");
// Read the text from the added image
var Result = Ocr.Read(Input);
// Print or process the retrieved text
Console.WriteLine(Result.Text);
}
' Install the Basque OCR language package for IronOcr
' PM> Install-Package IronOcr.Languages.Basque
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an empty OCR input
Using Input = New OcrInput()
' Add an image to the OCR input
Input.AddImage("images/sample.jpeg")
' Read the text from the added image
Dim Result = Ocr.Read(Input)
' Print or process the retrieved text
Console.WriteLine(Result.Text)
End Using
C# PDF OCR
Ikuspegi bera erabil daiteke era berean PDF edozein dokumentutatik testua ateratzeko.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for the PDF
using (var input = new OcrInput())
{
// Add the PDF and specify the password if necessary
input.AddPdf("example.pdf", "password");
// Read the text from the PDF input
var Result = Ocr.Read(input);
// Print the retrieved text and the number of pages
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count()} Pages");
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for the PDF
using (var input = new OcrInput())
{
// Add the PDF and specify the password if necessary
input.AddPdf("example.pdf", "password");
// Read the text from the PDF input
var Result = Ocr.Read(input);
// Print the retrieved text and the number of pages
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count()} Pages");
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for the PDF
Using input = New OcrInput()
' Add the PDF and specify the password if necessary
input.AddPdf("example.pdf", "password")
' Read the text from the PDF input
Dim Result = Ocr.Read(input)
' Print the retrieved text and the number of pages
Console.WriteLine(Result.Text)
Console.WriteLine($"{Result.Pages.Count()} Pages")
End Using
OCR MultiPage TIFFetarako
OCR irakurketa TIFF fitxategi formatua orrialde anitzeko dokumentuak barne. TIFF zuzenean PDF fitxategi bihur daiteke bilaketan bilatu daitekeen testuarekin.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for TIFF images
using (var Input = new OcrInput())
{
// Add a multi-page TIFF image
Input.AddMultiFrameTiff("multi-frame.tiff");
// Read the text from the input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for TIFF images
using (var Input = new OcrInput())
{
// Add a multi-page TIFF image
Input.AddMultiFrameTiff("multi-frame.tiff");
// Read the text from the input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for TIFF images
Using Input = New OcrInput()
' Add a multi-page TIFF image
Input.AddMultiFrameTiff("multi-frame.tiff")
' Read the text from the input
Dim Result = Ocr.Read(Input)
' Print the retrieved text
Console.WriteLine(Result.Text)
End Using
Barra-kodeak eta QR
IronOCR-ren ezaugarri berezia dokumentuen barra-kodeak eta QR kodeak irakur ditzake testua bilatzen ari den bitartean. OcrResult.OcrBarcode
klaseko instantziek garatzaileari eskaneatutako barra-kode bakoitzari buruzko informazio zehatza ematen diote.
using IronOcr;
var Ocr = new IronTesseract();
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
// Add an image with barcodes to the input
input.AddImage("img/Barcode.png");
// Read the text and barcodes from the input
var Result = Ocr.Read(input);
// Iterate through each detected barcode
foreach (var Barcode in Result.Barcodes)
{
// Print the barcode value
Console.WriteLine(Barcode.Value);
// Additional properties such as type and location are also available
}
}
using IronOcr;
var Ocr = new IronTesseract();
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
// Add an image with barcodes to the input
input.AddImage("img/Barcode.png");
// Read the text and barcodes from the input
var Result = Ocr.Read(input);
// Iterate through each detected barcode
foreach (var Barcode in Result.Barcodes)
{
// Print the barcode value
Console.WriteLine(Barcode.Value);
// Additional properties such as type and location are also available
}
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Enable barcode reading
Ocr.Configuration.ReadBarCodes = True
Using input = New OcrInput()
' Add an image with barcodes to the input
input.AddImage("img/Barcode.png")
' Read the text and barcodes from the input
Dim Result = Ocr.Read(input)
' Iterate through each detected barcode
For Each Barcode In Result.Barcodes
' Print the barcode value
Console.WriteLine(Barcode.Value)
' Additional properties such as type and location are also available
Next Barcode
End Using
Irudi-arlo espezifikoei buruzko OCR
IronOCRren eskaneatze- eta irakurketa-metodo guztiek testua irakurri nahi dugun orrialde edo orrialdeetako zein atal zehatz zehazteko aukera ematen dute. Hori oso erabilgarria da inprimaki normalizatuak aztertzen ari garenean eta denbora asko aurrez dezakegu eta eraginkortasuna hobetu.
Laborantza eskualdeak erabiltzeko, System.Drawing
sistemaren erreferentzia bat gehitu beharko dugu System.Drawing.Rectangle
objektua erabili ahal izateko.
using IronOcr;
using System.Drawing; // Ensure System.Drawing is referenced
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
using (var Input = new OcrInput())
{
// Define the content area to read
var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Measurements are in pixels
// Add the specific document region to the input
Input.Add("document.png", ContentArea);
// Read the text from the specified content area
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
using IronOcr;
using System.Drawing; // Ensure System.Drawing is referenced
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
using (var Input = new OcrInput())
{
// Define the content area to read
var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Measurements are in pixels
// Add the specific document region to the input
Input.Add("document.png", ContentArea);
// Read the text from the specified content area
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
Imports IronOcr
Imports System.Drawing ' Ensure System.Drawing is referenced
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
Using Input = New OcrInput()
' Define the content area to read
Dim ContentArea = New Rectangle() With {
.X = 215,
.Y = 1250,
.Height = 280,
.Width = 1335
}
' Measurements are in pixels
' Add the specific document region to the input
Input.Add("document.png", ContentArea)
' Read the text from the specified content area
Dim Result = Ocr.Read(Input)
' Print the retrieved text
Console.WriteLine(Result.Text)
End Using
OCR kalitate baxuko eskaneatzeetarako
IronOCR OcrInput
klaseak Tesseract normalak irakurri ezin dituen OcrInput
konpon ditzake.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for a low-quality image
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
// Improve the input quality by de-noising and deskewing
Input.DeNoise(); // Fix digital noise and poor scanning
Input.Deskew(); // Correct rotation and perspective
// Read the text from the improved input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for a low-quality image
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
// Improve the input quality by de-noising and deskewing
Input.DeNoise(); // Fix digital noise and poor scanning
Input.Deskew(); // Correct rotation and perspective
// Read the text from the improved input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for a low-quality image
Using Input = New OcrInput("img\Potter.LowQuality.tiff")
' Improve the input quality by de-noising and deskewing
Input.DeNoise() ' Fix digital noise and poor scanning
Input.Deskew() ' Correct rotation and perspective
' Read the text from the improved input
Dim Result = Ocr.Read(Input)
' Print the retrieved text
Console.WriteLine(Result.Text)
End Using
Esportatu OCR emaitzak bilatzeko PDF moduan
Irudia PDF formatuan kopiatzeko testu kateekin. Bilatzaileek eta datu-baseek indexatu dezakete.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input containing multiple images
using (var Input = new OcrInput())
{
// Set a title for the PDF
Input.Title = "Quarterly Report";
// Add multiple images to the input
Input.AddImage("image1.jpeg");
Input.AddImage("image2.png");
Input.AddImage("image3.gif");
// Read the texts from the images into a single result
var Result = Ocr.Read(Input);
// Save the OCR result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input containing multiple images
using (var Input = new OcrInput())
{
// Set a title for the PDF
Input.Title = "Quarterly Report";
// Add multiple images to the input
Input.AddImage("image1.jpeg");
Input.AddImage("image2.png");
Input.AddImage("image3.gif");
// Read the texts from the images into a single result
var Result = Ocr.Read(Input);
// Save the OCR result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input containing multiple images
Using Input = New OcrInput()
' Set a title for the PDF
Input.Title = "Quarterly Report"
' Add multiple images to the input
Input.AddImage("image1.jpeg")
Input.AddImage("image2.png")
Input.AddImage("image3.gif")
' Read the texts from the images into a single result
Dim Result = Ocr.Read(Input)
' Save the OCR result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf")
End Using
TIFF bilaketa PDF bihurtzeko
Aktibatu TIFF dokumentu bat (edo edozein irudi-fitxategi talde) zuzenean bilatzeko PDF batean, intranet, webgune eta google bilatzaileek indexatu ahal izateko.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for TIFF images
using (var Input = new OcrInput())
{
// Add a multi-frame TIFF image
Input.AddMultiFrameTiff("example.tiff");
// Read the text from the input and save as a searchable PDF
var Result = Ocr.Read(Input).SaveAsSearchablePdf("searchable.pdf");
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for TIFF images
using (var Input = new OcrInput())
{
// Add a multi-frame TIFF image
Input.AddMultiFrameTiff("example.tiff");
// Read the text from the input and save as a searchable PDF
var Result = Ocr.Read(Input).SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for TIFF images
Using Input = New OcrInput()
' Add a multi-frame TIFF image
Input.AddMultiFrameTiff("example.tiff")
' Read the text from the input and save as a searchable PDF
Dim Result = Ocr.Read(Input).SaveAsSearchablePdf("searchable.pdf")
End Using
Esportatu OCR emaitzak HTML gisa
OCR irudia XHTML bihurtzeko.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input containing an image
using (var Input = new OcrInput())
{
// Set a title for the HTML document
Input.Title = "Html Title";
// Add an image to the input
Input.AddImage("image1.jpeg");
// Read the text from the image
var Result = Ocr.Read(Input);
// Save the OCR result as an HTML file
Result.SaveAsHocrFile("results.html");
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input containing an image
using (var Input = new OcrInput())
{
// Set a title for the HTML document
Input.Title = "Html Title";
// Add an image to the input
Input.AddImage("image1.jpeg");
// Read the text from the image
var Result = Ocr.Read(Input);
// Save the OCR result as an HTML file
Result.SaveAsHocrFile("results.html");
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input containing an image
Using Input = New OcrInput()
' Set a title for the HTML document
Input.Title = "Html Title"
' Add an image to the input
Input.AddImage("image1.jpeg")
' Read the text from the image
Dim Result = Ocr.Read(Input)
' Save the OCR result as an HTML file
Result.SaveAsHocrFile("results.html")
End Using
OCR irudiak hobetzeko iragazkiak
IronOCR-k OcrInput
objektuentzako iragazki bakarrak eskaintzen ditu OCR errendimendua hobetzeko.
Irudia hobetzeko kodearen adibidea
OCR sarrerako irudiak kalitate handiagoa lortzen ditu OCR emaitza hobeak eta azkarragoak lortzeko.
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for a low-quality image
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
// Improve the input quality by de-noising and deskewing
Input.DeNoise(); // Fix digital noise and poor scanning
Input.Deskew(); // Correct rotation and perspective
// Read the text from the improved input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Create an OCR input for a low-quality image
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
// Improve the input quality by de-noising and deskewing
Input.DeNoise(); // Fix digital noise and poor scanning
Input.Deskew(); // Correct rotation and perspective
// Read the text from the improved input
var Result = Ocr.Read(Input);
// Print the retrieved text
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for a low-quality image
Using Input = New OcrInput("LowQuality.jpeg")
' Improve the input quality by de-noising and deskewing
Input.DeNoise() ' Fix digital noise and poor scanning
Input.Deskew() ' Correct rotation and perspective
' Read the text from the improved input
Dim Result = Ocr.Read(Input)
' Print the retrieved text
Console.WriteLine(Result.Text)
End Using
OCR irudi iragazkien zerrenda
IronOCR programan integratutako OCR errendimendua hobetzeko sarrera iragazkiak hauek dira:
- OcrInput.Rotate(degrees double) - Irudiak erlojuaren norabidean biratzen ditu. Erlojuaren aurkako norabidean, erabili zenbaki negatiboak.
- OcrInput.Binarize() - Irudi-iragazki honek pixel guztiak beltz edo zuri bihurtzen ditu bide ertainik gabe. Testuaren atzeko planoarekiko kontraste oso baxuko OCR errendimendu kasuak hobe ditzake.
- OcrInput.ToGrayScale() - Irudi-iragazki honek pixel bakoitza gris- tonuko tonu bihurtzen du. Nekez hobetuko du OCR zehaztasuna, baina abiadura hobe dezake
- OcrInput.Contrast() - Kontrastea automatikoki handitzen du. Iragazki honek askotan OCR abiadura eta zehaztasuna hobetzen ditu kontraste baxuko miaketetan.
- OcrInput.DeNoise() - Zarata digitala kentzen du. Iragazki hau zarata espero den tokian soilik erabili behar da.
- OcrInput.Invert() - Kolore guztiak alderantzikatzen ditu. Adibidez, zuria beltz bihurtzen da: beltza zuri bihurtzen da.
- OcrInput.Dilate() - Morfologia aurreratua. Dilatazioak pixelak gehitzen ditu irudi bateko objektuen mugetan. Erodearen aurkakoa
- OcrInput.Erode() - Morfologia aurreratua. Higadurak objektuen mugetan pixelak kentzen ditu Dilate of Opposite
- OcrInput.Deskew() - Irudi bat biratzen du, beraz, modu egokian gora eta ortogonala da. Hau oso erabilgarria da OCRrako, Tesseract-en tolerantzia okerreko miaketetan 5 gradu artekoa izan baitaiteke.
- OcrInput.DeepCleanBackgroundNoise() - Atzeko planoko zarata kentzea. Erabili iragazki hau soilik dokumentu muturreko atzeko zarata ezagutzen bada, iragazki honek dokumentu garbien OCR zehaztasuna murrizteko arriskua izango duelako eta CPU oso garestia delako.
- OcrInput.EnhanceResolution - Kalitate baxuko irudien bereizmena hobetzen du. Iragazki hau ez da askotan behar OcrInput.MinimumDPI eta OcrInput.TargetDPI bereizmen txikiko sarrerak automatikoki harrapatu eta ebatziko dituztelako .
GarbiketaHondoa. Hau denbora gutxi behar duen ezarpena da; hala ere, liburutegiak irudi digital baten barruan zarata digitala, papera xehatu eta bestelako akatsak automatikoki garbitzeko aukera ematen du, bestela beste OCR liburutegi batzuek irakurtzeko gaitasuna izango lukete.
EnhanceContrast IronOCR-k testuaren kontrastea irudi baten atzeko aldean automatikoki handitzen duen ezarpena da, OCRren zehaztasuna handituz eta, oro har, errendimendua eta OCR abiadura handituz.
EnhanceResolution bereizmen txikiko irudiak (275 dpi baino gutxiagokoak) automatikoki detektatuko dituen ezarpena da eta automatikoki irudia handitu eta testu guztia zorroztuko du, OCR liburutegi batek irakurri ahal izateko. Eragiketa honek berez denbora asko eskatzen duen arren, orokorrean irudi batean OCR eragiketa egiteko denbora orokorra murrizten du.
Language IronOCR-k nazioarteko 22 hizkuntza-pakete onartzen ditu eta hizkuntza-ezarpena OCR eragiketa batean aplikatu beharreko hizkuntza bat edo gehiago hautatzeko erabil daiteke.
Strategy IronOCR-k bi estrategia onartzen ditu. Aukeratu dezakegu dokumentu baten eskaneatze azkarra eta hain zehatza ez egitea edo adimen artifizialeko eredu batzuk erabiltzen dituen estrategia aurreratua erabiltzea OCR testuaren zehaztasuna automatikoki hobetzeko esaldi bateko hitzek elkarren artean duten erlazio estatistikoa aztertuz. .
ColorSpace ezarpena da, grisen eskalan edo koloretan OCR aukeratu ahal izateko. Oro har, grisen eskala da aukerarik onena. Hala ere, zenbaitetan antzeko tonua duten baina oso kolore desberdineko testuak edo atzeko planoak daudenean, kolore osoko espazio batek emaitza hobeak emango ditu.
DetectWhiteTextOnDarkBackgrounds. Oro har, OCR liburutegi guztiek testu beltza atzealde zurietan ikustea espero dute. Ezarpen horri esker, IronOCR-k testu zuridun negatiboak edo orrialde ilunak automatikoki detektatu eta irakurri ditzake.
InputImageType. Ezarpen horri esker, garatzaileak OCR liburutegia gidatu dezake dokumentu osoa edo zatitxo bat aztertzen ari den, pantaila-argazkia adibidez.
RotateAndStraighten ezarpen aurreratua da eta Iron OCRri biratu ez ezik, agian perspektiba duten dokumentuak irakurtzeko gaitasuna ere ematen dio Iron OCRri , testu dokumentuen argazkiak adibidez.
ReadBarcodes funtzio erabilgarria da eta IronOCR-k orrialdeetako barra-kodeak eta QR kodeak automatikoki irakurtzeko aukera ematen du testua ere irakurtzen baitu, denbora gehigarri handirik gehitu gabe.
KoloreSakonera. Ezarpen honek OCR liburutegiak kolore bakoitzeko sakonera zehazteko pixeleko zenbat bit erabiliko dituen zehazten du. Kolorearen sakonera altuagoak OCR kalitatea handitu dezake, baina OCR eragiketa burutzeko behar den denbora ere handituko da.
126 hizkuntza pakete
IronOCR-k nazioarteko 126 hizkuntza onartzen ditu DLL gisa banatzen diren hizkuntza paketeen bidez, webgune honetatik deskargatu daitezkeenak edo NuGet Package Manager- etik ere.
Hizkuntzen artean, alemana, frantsesa, ingelesa, txinera, japoniera eta beste asko daude. Hizkuntza pakete espezializatuak daude MRZ pasaportea, MICR egiaztapenak, datu ekonomikoak, matrikulak eta askoz gehiago. Tesseract ".traineddata" fitxategia ere erabil dezakezu - zuk zeuk sortutakoak barne.
Hizkuntza adibidea
Beste OCR hizkuntza batzuk erabiltzea.
using IronOcr;
// Install the Arabic OCR language package for IronOcr
// PM> Install IronOcr.Languages.Arabic
var Ocr = new IronTesseract();
// Set the detection language to Arabic
Ocr.Language = OcrLanguage.Arabic;
using (var input = new OcrInput())
{
// Add an Arabic text image to the input
input.AddImage("img/arabic.gif");
// Try different image filters if needed
// In this case, assume the input is of very low quality
// IronTesseract can read what regular Tesseract cannot
// Read the text from the input
var Result = Ocr.Read(input);
// The console may not print Arabic characters easily on Windows
// Save the result to a text file instead
Result.SaveAsTextFile("arabic.txt");
}
using IronOcr;
// Install the Arabic OCR language package for IronOcr
// PM> Install IronOcr.Languages.Arabic
var Ocr = new IronTesseract();
// Set the detection language to Arabic
Ocr.Language = OcrLanguage.Arabic;
using (var input = new OcrInput())
{
// Add an Arabic text image to the input
input.AddImage("img/arabic.gif");
// Try different image filters if needed
// In this case, assume the input is of very low quality
// IronTesseract can read what regular Tesseract cannot
// Read the text from the input
var Result = Ocr.Read(input);
// The console may not print Arabic characters easily on Windows
// Save the result to a text file instead
Result.SaveAsTextFile("arabic.txt");
}
Imports IronOcr
' Install the Arabic OCR language package for IronOcr
' PM> Install IronOcr.Languages.Arabic
Private Ocr = New IronTesseract()
' Set the detection language to Arabic
Ocr.Language = OcrLanguage.Arabic
Using input = New OcrInput()
' Add an Arabic text image to the input
input.AddImage("img/arabic.gif")
' Try different image filters if needed
' In this case, assume the input is of very low quality
' IronTesseract can read what regular Tesseract cannot
' Read the text from the input
Dim Result = Ocr.Read(input)
' The console may not print Arabic characters easily on Windows
' Save the result to a text file instead
Result.SaveAsTextFile("arabic.txt")
End Using
Hizkuntza anitzeko adibidea
OCR ere posible da hainbat hizkuntza aldi berean erabiliz. Honek Unicode dokumentuetan ingelesezko metadatuak eta URLak lortzen lagun dezake.
using IronOcr;
// Install the ChineseSimplified OCR language package for IronOcr
// PM> Install IronOcr.Languages.ChineseSimplified
var Ocr = new IronTesseract();
// Set the primary detection language to Simplified Chinese
Ocr.Language = OcrLanguage.ChineseSimplified;
// Add additional languages
Ocr.AddSecondaryLanguage(OcrLanguage.Basque);
// You can add any number of languages
using (var input = new OcrInput())
{
// Add a multi-language PDF document
input.Add("multi-language.pdf");
// Read the text from the input
var Result = Ocr.Read(input);
// Save the resulting text in a file
Result.SaveAsTextFile("results.txt");
}
using IronOcr;
// Install the ChineseSimplified OCR language package for IronOcr
// PM> Install IronOcr.Languages.ChineseSimplified
var Ocr = new IronTesseract();
// Set the primary detection language to Simplified Chinese
Ocr.Language = OcrLanguage.ChineseSimplified;
// Add additional languages
Ocr.AddSecondaryLanguage(OcrLanguage.Basque);
// You can add any number of languages
using (var input = new OcrInput())
{
// Add a multi-language PDF document
input.Add("multi-language.pdf");
// Read the text from the input
var Result = Ocr.Read(input);
// Save the resulting text in a file
Result.SaveAsTextFile("results.txt");
}
Imports IronOcr
' Install the ChineseSimplified OCR language package for IronOcr
' PM> Install IronOcr.Languages.ChineseSimplified
Private Ocr = New IronTesseract()
' Set the primary detection language to Simplified Chinese
Ocr.Language = OcrLanguage.ChineseSimplified
' Add additional languages
Ocr.AddSecondaryLanguage(OcrLanguage.Basque)
' You can add any number of languages
Using input = New OcrInput()
' Add a multi-language PDF document
input.Add("multi-language.pdf")
' Read the text from the input
Dim Result = Ocr.Read(input)
' Save the resulting text in a file
Result.SaveAsTextFile("results.txt")
End Using
OCR emaitzen xehetasunak
IronOCR-k OCR emaitza objektu bat itzultzen du OCR eragiketa bakoitzerako. Orokorrean, garatzaileek objektu honen testuaren propietatea soilik erabiltzen dute iruditik eskaneatutako testua lortzeko. Hala ere, OCR emaitzen DOM hau baino askoz aurreratuagoa da.
using IronOcr;
using System.Drawing; // Add reference to System.Drawing assembly
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Configure the engine to use both Tesseract and LSTM
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true; //! Important
using (var Input = new OcrInput(@"images\sample.tiff"))
{
// Perform OCR and get the result
OcrResult Result = Ocr.Read(Input);
// Explore the OCR result
var Pages = Result.Pages;
var Words = Pages[0].Words;
var Barcodes = Result.Barcodes;
// Explore the extensive and precise API to discover:
// - Pages, Blocks, Paragraphs, Lines, Words, Letters
// - Image exportation, font coordinates, statistical data
}
using IronOcr;
using System.Drawing; // Add reference to System.Drawing assembly
var Ocr = new IronTesseract();
// Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque;
// Configure the engine to use both Tesseract and LSTM
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true; //! Important
using (var Input = new OcrInput(@"images\sample.tiff"))
{
// Perform OCR and get the result
OcrResult Result = Ocr.Read(Input);
// Explore the OCR result
var Pages = Result.Pages;
var Words = Pages[0].Words;
var Barcodes = Result.Barcodes;
// Explore the extensive and precise API to discover:
// - Pages, Blocks, Paragraphs, Lines, Words, Letters
// - Image exportation, font coordinates, statistical data
}
Imports IronOcr
Imports System.Drawing ' Add reference to System.Drawing assembly
Private Ocr = New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Configure the engine to use both Tesseract and LSTM
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm
' Enable barcode reading
Ocr.Configuration.ReadBarCodes = True '! Important
Using Input = New OcrInput("images\sample.tiff")
' Perform OCR and get the result
Dim Result As OcrResult = Ocr.Read(Input)
' Explore the OCR result
Dim Pages = Result.Pages
Dim Words = Pages(0).Words
Dim Barcodes = Result.Barcodes
' Explore the extensive and precise API to discover:
' - Pages, Blocks, Paragraphs, Lines, Words, Letters
' - Image exportation, font coordinates, statistical data
End Using
Emanaldia
IronOCR kutxatik kanpo funtzionatzen du sarrerako irudiak sintonizatu edo aldatu beharrik gabe.
Speed is Blazing: IronOcr.2020 + 10 aldiz azkarragoa da eta aurreko eraikuntzek baino% 250 baino gutxiago akats gutxiago egiten ditu.
Gehiago ikasi
C#, VB, F# edo .NET beste edozein hizkuntzatan OCR-ri buruz gehiago jakiteko, irakurri gure komunitateko tutorialak, IronOCR nola erabil daitekeen erakusten duten benetako adibideak ematen dituztenak eta ahalik eta etekin onena ateratzeko ñabardurak erakusten dituztenak. liburutegi hau.
.NET garatzaileentzako objektuen erreferentzia osoa ere eskuragarri dago.