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 Tesseract 4 LSTM dil dosyası/sözlüğü eğitmeyi 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, bu YouTube eğitimini (ilişik yok) ve Gabriel Garcia'nın bağlantılı GitHub deposunu öneriyoruz.
Çeviri tamamlandığında, çıktı .traineddata dosyası olacaktır.
.traineddata dosyası, IronOCR'da aşağıdaki şekilde 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

