IronOCR ile Özel OCR Dil Paketleri Kullanma
IronOCR'de kullanılmak üzere özel dil paketleri nasıl oluşturulur?
Özel bir dil paketi oluşturmak, bir yazı tipinden yeni bir Tesseract LSTM dil dosyası/sözlüğü eğitilmesini gerektirir.
Bu işlemi yapmak için gereken adımları açıklayan birçok çevrimiçi eğitim bulunmaktadır. Süreç basit olmasa da, neyse ki oldukça iyi belgelenmiştir.
Başlamak için iyi bir yer olarak, YouTube öğreticisini Gabriel Garcia'dan (hiçbir bağlantı yoktur) ve bağlantılı GitHub deposunu öneriyoruz.
Tamamlandığında, çıktı bir .traineddata dosyası olacaktır.
Ardından, .traineddata dosyası IronOCR'da aşağıdaki gibi referans alınabilir:
Dokümantasyon: IronOCR Özel Diller
using IronOcr;
class Program
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata"); //<--- your new font
// Multiple fonts can be used by calling the method multiple times with different files
// Load an image into the OCR Input for processing
using (var Input = new OcrInput())
{
Input.LoadImage(@"images\image.png");
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}
}
}Imports IronOcr
Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata") '<--- your new font
' Multiple fonts can be used by calling the method multiple times with different files
' Load an image into the OCR Input for processing
Using Input = New OcrInput()
Input.LoadImage("images\image.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using
End Sub
End ClassImports IronOcr
Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Load your custom Tesseract language file (trained .traineddata file)
Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata") '<--- your new font
' Multiple fonts can be used by calling the method multiple times with different files
' Load an image into the OCR Input for processing
Using Input = New OcrInput()
Input.LoadImage("images\image.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using
End Sub
End ClassCurtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.