IronOCR ile Özel OCR Dil Paketlerini Kullanma
IronOCR'de kullanılmak üzere özel dil paketleri nasıl oluşturulur?
Özel bir dil paketi oluşturmak için bir yazı tipinden yeni bir Tesseract 4 LSTM dil dosyası/sözlüğü eğitilmesi gereklidir.
Bu işlemi yapmak için gereken adımları açıklayan birçok çevrimiçi eğitim bulunmaktadır. Süreç basit değil, ancak neyse ki oldukça iyi belgelenmiş.
Başlamak için iyi bir yer olarak, Gabriel Garcia (bağlantı yok) tarafından hazırlanan bu YouTube eğitimi ve onların bağlantılı GitHub deposu öneriyoruz.
Tamamlandığında, çıktı bir .traineddata dosyası olacaktır.
.traineddata dosyası daha sonra 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(@"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);
}
}
}
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(@"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
Friend 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("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 Class

