<meta http-equiv="content-language" content="eu" />
<h1>Euskal OCR C# eta .NET-en</h1>
<h6>Dokumentu honen beste bertsio batzuk:</h6>
<ul>
<li><a rel='alternate' hreflang='en' href="/csharp/ocr/languages/basque/">Ingelesa (This Page in English)</a></li>
<li><a href="/csharp/ocr/languages/">Languages gehiago</a></li>
</ul>
<p>IronOCR C# softwarearen osagaia da .NET kodetzaileek 126 hizkuntzatako irudien eta PDF dokumentuen testua irakurtzea 126 hizkuntzatan, euskara barne.</p>
<p>Tesseract-en sardexka aurreratua da, .NET garatzaileentzat soilik eraikia eta aldian-aldian beste Tesseract motorrak gainditzen ditu abiadura eta zehaztasunagatik.</p>
<h2>IronOcr.Hizkuntzak.Euskara-ren edukia</h2>
<p>Pakete honek .NETerako 43 OCR hizkuntza ditu:</p>
<ul>
<li>Euskara</li>
<li>EuskaraBest</li>
<li>BasqueFast</li>
</ul>
<h2>Deskargatu</h2>
<p>Euskara Pack <span style='white-space:default'>[euskara]</span> <br/> * Download as <a class='languages-dll' href='/csharp/ocr/packages/language-packs/Basque.ocrdata.zip'>Zip <i class='fas fa-download'></i><br/> * Install with NuGet as </a><a target='_blank' class='languages-nuget' href="https://www.nuget.org/packages/IronOcr.Languages.Basque/">https://www.nuget.org/packages/IronOcr.Languages.Basque/</a><i class='nuget-icon'></i></p>
<h2>Instalazioa</h2>
<p>Egin behar dugun lehenengo gauza gure <strong>euskal</strong> OCR paketea zure .NET proiektuan instalatzea da.</p>
<p><code>PM> Install-Package IronOcr.Languages.Basque</code></p>
<h2>Kodearen adibidea</h2>
<p>C# kode adibide honek Image edo PDF dokumentu bateko euskarazko testua irakurtzen du.</p>
```csharp
// 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;
}
```
<h2>Zergatik aukeratu IronOCR?</h2>
<p>IronOCR .NET software liburutegia instalatzen erraza, osoa eta ondo dokumentatuta dago.</p>
<p>Aukeratu IronOCR <strong>% 99,8 + OCR zehaztasuna</strong> lortzeko kanpoko web zerbitzurik, etengabeko tasarik edo Internet bidez isilpeko dokumentuak bidali gabe.</p>
<h4>Zergatik aukeratzen dute C# garatzaileek IronOCR Vanilla Tesseract baino?</h4>
<ul>
<li>Instalatu DLL edo NuGet bakar gisa</li>
<li>Tesseract 5, 4 eta 3 motorretarako sartzen da kutxatik kanpora.</li>
<li>Zehaztasunak <strong>%</strong> 99,8k ohiko Tesseract gainditzen du.</li>
<li>Blazing Speed eta MultiThreading</li>
<li>MVC, WebApp, Desktop, Console & Server Application bateragarriak dira</li>
<li>Ez dago Exes edo C ++ koderik lan egiteko</li>
<li>PDF OCR laguntza osoa</li>
<li>OCR ia edozein irudi fitxategi edo PDF egiteko</li>
<li>.NET Core, Standard eta FrameWork euskarri osoa</li>
<li>Inplementatu Windows, Mac, Linux, Azure, Docker, Lambda, AWS zerbitzuetan</li>
<li>Irakurri barra-kodeak eta QR kodeak</li>
<li>Esportatu OCR XHTML gisa</li>
<li>Esportatu OCR bilatzeko PDF dokumentuetara</li>
<li>Multithreading euskarria</li>
<li>Nazioarteko 126 hizkuntza guztiak NuGet edo OcrData fitxategien bidez kudeatuak</li>
<li>Atera irudiak, koordenatuak, estatistikak eta letra tipoak. Ez bakarrik testua.</li>
<li>Tesseract OCR birbanatzeko aplikazio komertzial eta jabedunen barruan banatzeko erabil daiteke.</li>
</ul>
<p><em>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.</em></p>
<p>.NET plataformarako <a href="/csharp/ocr/use-case/free-ocr-csharp/">doako</a> beste <a href="/csharp/ocr/use-case/free-ocr-csharp/">OCR</a> liburutegi batzuek .NET Tesseract APIak eta web zerbitzuek ez dute hain ondo funtzionatzen mundu errealeko erabilera kasu hauetan.</p>
<h2>OCR Tesseract 5-rekin - Hasi kodeketa C#-ean</h2>
<p>Beheko kode laginak erakusten du zein erraza den C# edo VB .NET erabiliz irudi bateko testua irakurtzea.</p>
<h3>OneLiner</h3>
```csharp
// A simple one-liner to read text from an image using IronOcr
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
```
<h3>Konfiguratu Hello World</h3>
```csharp
// 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);
}
```
<h3>C# PDF OCR</h3>
<p>Ikuspegi bera erabil daiteke era berean PDF edozein dokumentutatik testua ateratzeko.</p>
```csharp
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");
}
```
<h3>OCR MultiPage TIFFetarako</h3>
<p> OCR irakurketa TIFF fitxategi formatua orrialde anitzeko dokumentuak barne. TIFF zuzenean PDF fitxategi bihur daiteke bilaketan bilatu daitekeen testuarekin.</p>
```csharp
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);
}
```
<h3>Barra-kodeak eta QR</h3>
<p>IronOCR-ren ezaugarri berezia dokumentuen barra-kodeak eta QR kodeak irakur ditzake testua bilatzen ari den bitartean. <code>OcrResult.OcrBarcode</code> klaseko instantziek garatzaileari eskaneatutako barra-kode bakoitzari buruzko informazio zehatza ematen diote.</p>
```csharp
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
}
}
```
<h3>Irudi-arlo espezifikoei buruzko OCR</h3>
<p>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.</p>
<p>Laborantza eskualdeak erabiltzeko, <code>System.Drawing</code> sistemaren erreferentzia bat gehitu beharko dugu <code>System.Drawing.Rectangle</code> objektua erabili ahal izateko.</p>
```csharp
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);
}
```
<h3>OCR kalitate baxuko eskaneatzeetarako</h3>
<p>IronOCR <code>OcrInput</code> klaseak Tesseract normalak irakurri ezin dituen <code>OcrInput</code> konpon ditzake.</p>
```csharp
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);
}
```
<h3>Esportatu OCR emaitzak bilatzeko PDF moduan</h3>
<p>Irudia PDF formatuan kopiatzeko testu kateekin. Bilatzaileek eta datu-baseek indexatu dezakete.</p>
```csharp
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");
}
```
<h3>TIFF bilaketa PDF bihurtzeko</h3>
<p>Aktibatu TIFF dokumentu bat (edo edozein irudi-fitxategi talde) zuzenean bilatzeko PDF batean, intranet, webgune eta google bilatzaileek indexatu ahal izateko.</p>
```csharp
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");
}
```
<h3>Esportatu OCR emaitzak HTML gisa</h3>
<p>OCR irudia XHTML bihurtzeko.</p>
```csharp
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");
}
```
<h2>OCR irudiak hobetzeko iragazkiak</h2>
<p>IronOCR-k <code>OcrInput</code> objektuentzako iragazki bakarrak eskaintzen ditu OCR errendimendua hobetzeko.</p>
<h3>Irudia hobetzeko kodearen adibidea</h3>
<p>OCR sarrerako irudiak kalitate handiagoa lortzen ditu OCR emaitza hobeak eta azkarragoak lortzeko.</p>
```csharp
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);
}
```
<h3>OCR irudi iragazkien zerrenda</h3>
<p>IronOCR programan integratutako OCR errendimendua hobetzeko sarrera iragazkiak hauek dira:</p>
<ul>
<li><strong>OcrInput.Rotate(degrees double)</strong> - Irudiak erlojuaren norabidean biratzen ditu. Erlojuaren aurkako norabidean, erabili zenbaki negatiboak.</li>
<li><strong>OcrInput.Binarize()</strong> - Irudi-iragazki honek pixel guztiak beltz edo zuri bihurtzen ditu bide <strong>ertainik</strong> gabe. Testuaren atzeko planoarekiko kontraste oso baxuko OCR errendimendu kasuak hobe ditzake.</li>
<li><strong>OcrInput.ToGrayScale()</strong> - Irudi-iragazki honek pixel bakoitza gris- <strong>tonuko tonu</strong> bihurtzen du. Nekez hobetuko du OCR zehaztasuna, baina abiadura hobe dezake</li>
<li><strong>OcrInput.Contrast()</strong> - Kontrastea automatikoki handitzen du. Iragazki honek askotan OCR abiadura eta zehaztasuna hobetzen ditu kontraste baxuko miaketetan.</li>
<li><strong>OcrInput.DeNoise()</strong> - Zarata digitala kentzen du. Iragazki hau zarata espero den tokian soilik erabili behar da.</li>
<li><strong>OcrInput.Invert()</strong> - Kolore guztiak alderantzikatzen ditu. Adibidez, zuria beltz bihurtzen da: beltza zuri bihurtzen da.</li>
<li><strong>OcrInput.Dilate()</strong> - Morfologia aurreratua. <em>Dilatazioak</em> pixelak gehitzen ditu irudi bateko objektuen mugetan. Erodearen aurkakoa</li>
<li><strong>OcrInput.Erode()</strong> - Morfologia aurreratua. <em>Higadurak</em> objektuen mugetan pixelak kentzen ditu Dilate of Opposite</li>
<li><strong>OcrInput.Deskew()</strong> - 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.</li>
<li><strong>OcrInput.DeepCleanBackgroundNoise()</strong> - 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.</li>
<li><strong>OcrInput.EnhanceResolution</strong> - Kalitate baxuko irudien bereizmena hobetzen du. Iragazki hau ez da askotan behar <em>OcrInput.MinimumDPI</em> eta <em>OcrInput.TargetDPI</em> bereizmen txikiko sarrerak automatikoki harrapatu eta <em>ebatziko</em> <em>dituztelako</em> .</li>
</ul>
<p><strong>GarbiketaHondoa.</strong> 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.</p>
<p><strong>EnhanceContrast</strong> IronOCR-k testuaren kontrastea irudi baten atzeko aldean automatikoki handitzen duen ezarpena da, <strong>OCRren</strong> zehaztasuna handituz eta, oro har, errendimendua eta OCR abiadura handituz.</p>
<p><strong>EnhanceResolution</strong> 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.</p>
<p><strong>Language</strong> IronOCR-k nazioarteko 22 hizkuntza-pakete onartzen ditu eta hizkuntza-ezarpena OCR eragiketa batean aplikatu beharreko hizkuntza bat edo gehiago hautatzeko erabil daiteke.</p>
<p><strong>Strategy</strong> 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. .</p>
<p><strong>ColorSpace</strong> 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.</p>
<p><strong>DetectWhiteTextOnDarkBackgrounds.</strong> 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.</p>
<p><strong>InputImageType.</strong> Ezarpen horri esker, garatzaileak OCR liburutegia gidatu dezake dokumentu osoa edo zatitxo bat aztertzen ari den, pantaila-argazkia adibidez.</p>
<p><strong>RotateAndStraighten</strong> ezarpen aurreratua da eta Iron <strong>OCRri</strong> biratu ez ezik, agian perspektiba duten dokumentuak irakurtzeko gaitasuna ere ematen dio Iron <strong>OCRri</strong> , testu dokumentuen argazkiak adibidez.</p>
<p><strong>ReadBarcodes</strong> 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.</p>
<p><strong>KoloreSakonera.</strong> 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.</p>
<h2>126 hizkuntza pakete</h2>
<p>IronOCR-k <strong>nazioarteko 126 hizkuntza</strong> onartzen ditu DLL gisa banatzen diren hizkuntza paketeen bidez, <a href="/csharp/ocr/languages/">webgune honetatik deskargatu</a> daitezkeenak edo <a href="https://www.nuget.org/packages?q=IronOcr.Languages">NuGet Package Manager-</a> etik ere.</p>
<p>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.</p>
<h3>Hizkuntza adibidea</h3>
<p>Beste OCR hizkuntza batzuk erabiltzea.</p>
```csharp
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");
}
```
<h3>Hizkuntza anitzeko adibidea</h3>
<p>OCR ere posible da hainbat hizkuntza aldi berean erabiliz. Honek Unicode dokumentuetan ingelesezko metadatuak eta URLak lortzen lagun dezake.</p>
```csharp
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");
}
```
<h2>OCR emaitzen xehetasunak</h2>
<p>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.</p>
```csharp
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
}
```
<h2>Emanaldia</h2>
<p>IronOCR kutxatik kanpo funtzionatzen du sarrerako irudiak sintonizatu edo aldatu beharrik gabe.</p>
<p>Speed is Blazing: IronOCR.2020 + 10 aldiz azkarragoa da eta aurreko eraikuntzek baino% 250 baino gutxiago akats gutxiago egiten ditu.</p>
<h2>Gehiago ikasi</h2>
<p>C#, VB, F# edo .NET beste edozein hizkuntzatan OCR-ri buruz gehiago jakiteko, <a href="/csharp/ocr/tutorials/how-to-read-text-from-an-image-in-csharp-net/">irakurri gure komunitateko tutorialak</a>, IronOCR nola erabil daitekeen erakusten duten benetako adibideak ematen dituztenak eta ahalik eta etekin onena ateratzeko ñabardurak erakusten dituztenak. liburutegi hau.</p>
<p><a href="/csharp/ocr/object-reference/api/">.NET garatzaileentzako objektuen erreferentzia</a> osoa ere eskuragarri dago.</p>
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.
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.Basqueusing IronOcr;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input from an imageusing (varInput = new OcrInput(@"images\Basque.png")){ // Read the text from the image varResult = Ocr.Read(Input); // Print or process the retrieved text varAllText = 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.BasqueImportsIronOcrPrivateOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input from an imageUsingInput = New OcrInput("images\Basque.png") ' Read the text from the image DimResult = Ocr.Read(Input) ' Print or process the retrieved text DimAllText = Result.TextEndUsing
' 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
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 IronOcrstringText = 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 IronOcrDimTextAsString = (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.Basqueusing IronOcr;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an empty OCR inputusing (varInput = new OcrInput()){ // Add an image to the OCR inputInput.AddImage("images/sample.jpeg"); // Read the text from the added image varResult = Ocr.Read(Input); // Print or process the retrieved textConsole.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.BasqueImportsIronOcrPrivateOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an empty OCR inputUsingInput = New OcrInput() ' Add an image to the OCR inputInput.AddImage("images/sample.jpeg") ' Read the text from the added image DimResult = Ocr.Read(Input) ' Print or process the retrieved textConsole.WriteLine(Result.Text)EndUsing
' 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input for the PDFusing (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 varResult = Ocr.Read(input); // Print the retrieved text and the number of pagesConsole.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");
}
ImportsIronOcrDimOcrAs New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input for the PDFUsing input As New OcrInput() ' Add the PDF and specify the password if necessary input.AddPdf("example.pdf", "password") ' Read the text from the PDF input DimResult = Ocr.Read(input) ' Print the retrieved text and the number of pagesConsole.WriteLine(Result.Text)Console.WriteLine($"{Result.Pages.Count()} Pages")EndUsing
Imports IronOcr
Dim Ocr As New IronTesseract()
' Set the detection language to Basque
Ocr.Language = OcrLanguage.Basque
' Create an OCR input for the PDF
Using input As 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input for TIFF imagesusing (varInput = new OcrInput()){ // Add a multi-page TIFF imageInput.AddMultiFrameTiff("multi-frame.tiff"); // Read the text from the input varResult = Ocr.Read(Input); // Print the retrieved textConsole.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);
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input for TIFF imagesUsingInput = New OcrInput() ' Add a multi-page TIFF imageInput.AddMultiFrameTiff("multi-frame.tiff") ' Read the text from the input DimResult = Ocr.Read(Input) ' Print the retrieved textConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Dim 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;varOcr = new IronTesseract();// Enable barcode readingOcr.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 varResult = Ocr.Read(input); // Iterate through each detected barcode foreach (varBarcodeinResult.Barcodes) { // Print the barcode valueConsole.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
}
}
ImportsIronOcrDimOcr = New IronTesseract()' Enable barcode readingOcr.Configuration.ReadBarCodes = TrueUsing input = New OcrInput() ' Add an image with barcodes to the input input.AddImage("img/Barcode.png") ' Read the text and barcodes from the input DimResult = Ocr.Read(input) ' Iterate through each detected barcode For EachBarcodeInResult.Barcodes ' Print the barcode valueConsole.WriteLine(Barcode.Value) ' Additional properties such as type and location are also available NextEndUsing
Imports IronOcr
Dim 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
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 referencedvarOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;using (varInput = new OcrInput()){ // Define the content area to read varContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 }; // Measurements are in pixels // Add the specific document region to the inputInput.Add("document.png", ContentArea); // Read the text from the specified content area varResult = Ocr.Read(Input); // Print the retrieved textConsole.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);
}
ImportsIronOcrImportsSystem.Drawing' Ensure System.Drawing is referencedDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.BasqueUsingInput = New OcrInput() ' Define the content area to read DimContentArea = New Rectangle() With {.X = 215, .Y = 1250, .Height = 280, .Width = 1335} ' Measurements are in pixels ' Add the specific document region to the inputInput.Add("document.png", ContentArea) ' Read the text from the specified content area DimResult = Ocr.Read(Input) ' Print the retrieved textConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Imports System.Drawing ' Ensure System.Drawing is referenced
Dim 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input for a low-quality imageusing (varInput = new OcrInput(@"img\Potter.LowQuality.tiff")){ // Improve the input quality by de-noising and deskewingInput.DeNoise(); // Fix digital noise and poor scanningInput.Deskew(); // Correct rotation and perspective // Read the text from the improved input varResult = Ocr.Read(Input); // Print the retrieved textConsole.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);
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input for a low-quality imageUsingInput = New OcrInput("img\Potter.LowQuality.tiff") ' Improve the input quality by de-noising and deskewingInput.DeNoise() ' Fix digital noise and poor scanningInput.Deskew() ' Correct rotation and perspective ' Read the text from the improved input DimResult = Ocr.Read(Input) ' Print the retrieved textConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Dim 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input containing multiple imagesusing (varInput = new OcrInput()){ // Set a title for the PDFInput.Title = "Quarterly Report"; // Add multiple images to the inputInput.AddImage("image1.jpeg");Input.AddImage("image2.png");Input.AddImage("image3.gif"); // Read the texts from the images into a single result varResult = Ocr.Read(Input); // Save the OCR result as a searchable PDFResult.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");
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input containing multiple imagesUsingInput = New OcrInput() ' Set a title for the PDFInput.Title = "Quarterly Report" ' Add multiple images to the inputInput.AddImage("image1.jpeg")Input.AddImage("image2.png")Input.AddImage("image3.gif") ' Read the texts from the images into a single result DimResult = Ocr.Read(Input) ' Save the OCR result as a searchable PDFResult.SaveAsSearchablePdf("searchable.pdf")EndUsing
Imports IronOcr
Dim 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input for TIFF imagesusing (varInput = new OcrInput()){ // Add a multi-frame TIFF imageInput.AddMultiFrameTiff("example.tiff"); // Read the text from the input and save as a searchable PDF varResult = 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");
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input for TIFF imagesUsingInput = New OcrInput() ' Add a multi-frame TIFF imageInput.AddMultiFrameTiff("example.tiff") ' Read the text from the input and save as a searchable PDF DimResult = Ocr.Read(Input).SaveAsSearchablePdf("searchable.pdf")EndUsing
Imports IronOcr
Dim 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input containing an imageusing (varInput = new OcrInput()){ // Set a title for the HTML documentInput.Title = "Html Title"; // Add an image to the inputInput.AddImage("image1.jpeg"); // Read the text from the image varResult = Ocr.Read(Input); // Save the OCR result as an HTML fileResult.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");
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input containing an imageUsingInput = New OcrInput() ' Set a title for the HTML documentInput.Title = "Html Title" ' Add an image to the inputInput.AddImage("image1.jpeg") ' Read the text from the image DimResult = Ocr.Read(Input) ' Save the OCR result as an HTML fileResult.SaveAsHocrFile("results.html")EndUsing
Imports IronOcr
Dim 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;varOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Create an OCR input for a low-quality imageusing (varInput = new OcrInput(@"LowQuality.jpeg")){ // Improve the input quality by de-noising and deskewingInput.DeNoise(); // Fix digital noise and poor scanningInput.Deskew(); // Correct rotation and perspective // Read the text from the improved input varResult = Ocr.Read(Input); // Print the retrieved textConsole.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);
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Create an OCR input for a low-quality imageUsingInput = New OcrInput("LowQuality.jpeg") ' Improve the input quality by de-noising and deskewingInput.DeNoise() ' Fix digital noise and poor scanningInput.Deskew() ' Correct rotation and perspective ' Read the text from the improved input DimResult = Ocr.Read(Input) ' Print the retrieved textConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Dim 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 ebatzikodituztelako .
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.
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.ArabicvarOcr = new IronTesseract();// Set the detection language to ArabicOcr.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 varResult = Ocr.Read(input); // The console may not print Arabic characters easily on Windows // Save the result to a text file insteadResult.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");
}
ImportsIronOcr' Install the Arabic OCR language package for IronOcr' PM> Install IronOcr.Languages.ArabicDimOcrAs New IronTesseract()' Set the detection language to ArabicOcr.Language = OcrLanguage.ArabicUsing input As 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 DimResult = Ocr.Read(input) ' The console may not print Arabic characters easily on Windows ' Save the result to a text file insteadResult.SaveAsTextFile("arabic.txt")EndUsing
Imports IronOcr
' Install the Arabic OCR language package for IronOcr
' PM> Install IronOcr.Languages.Arabic
Dim Ocr As New IronTesseract()
' Set the detection language to Arabic
Ocr.Language = OcrLanguage.Arabic
Using input As 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.ChineseSimplifiedvarOcr = new IronTesseract();// Set the primary detection language to Simplified ChineseOcr.Language = OcrLanguage.ChineseSimplified;// Add additional languagesOcr.AddSecondaryLanguage(OcrLanguage.Basque);// You can add any number of languagesusing (var input = new OcrInput()){ // Add a multi-language PDF document input.Add("multi-language.pdf"); // Read the text from the input varResult = Ocr.Read(input); // Save the resulting text in a fileResult.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");
}
ImportsIronOcr' Install the ChineseSimplified OCR language package for IronOcr' PM> Install IronOcr.Languages.ChineseSimplifiedDimOcr = New IronTesseract()' Set the primary detection language to Simplified ChineseOcr.Language = OcrLanguage.ChineseSimplified' Add additional languagesOcr.AddSecondaryLanguage(OcrLanguage.Basque)' You can add any number of languagesUsing input = New OcrInput() ' Add a multi-language PDF document input.Add("multi-language.pdf") ' Read the text from the input DimResult = Ocr.Read(input) ' Save the resulting text in a fileResult.SaveAsTextFile("results.txt")EndUsing
Imports IronOcr
' Install the ChineseSimplified OCR language package for IronOcr
' PM> Install IronOcr.Languages.ChineseSimplified
Dim 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 assemblyvarOcr = new IronTesseract();// Set the detection language to BasqueOcr.Language = OcrLanguage.Basque;// Configure the engine to use both Tesseract and LSTMOcr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;// Enable barcode readingOcr.Configuration.ReadBarCodes = true; //! Importantusing (varInput = new OcrInput(@"images\sample.tiff")){ // Perform OCR and get the result OcrResultResult = Ocr.Read(Input); // Explore the OCR result varPages = Result.Pages; varWords = Pages[0].Words; varBarcodes = 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
}
ImportsIronOcrImportsSystem.Drawing' Add reference to System.Drawing assemblyDimOcr = New IronTesseract()' Set the detection language to BasqueOcr.Language = OcrLanguage.Basque' Configure the engine to use both Tesseract and LSTMOcr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm' Enable barcode readingOcr.Configuration.ReadBarCodes = True ' ImportantUsingInput = New OcrInput("images\sample.tiff") ' Perform OCR and get the result DimResultAsOcrResult = Ocr.Read(Input) ' Explore the OCR result DimPages = Result.Pages DimWords = Pages(0).Words DimBarcodes = Result.Barcodes ' Explore the extensive and precise API to discover: ' - Pages, Blocks, Paragraphs, Lines, Words, Letters ' - Image exportation, font coordinates, statistical dataEndUsing
Imports IronOcr
Imports System.Drawing ' Add reference to System.Drawing assembly
Dim 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.
커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.