Altbilgi içeriğine atla
IRONOCR KULLANıMı

Makbuz Tarama API'si: C# ve IronOCR Kullanarak Makbuzlardan Veri Çıkarma

Fiş tarama API'leri, OCR teknolojisini kullanarak fişlerden veri çıkarmayı otomatikleştirir, manuel giriş hatalarını önemli ölçüde azaltır ve işlem süresini hızlandırır. Bu kılavuz, IronOCR'u C#'ta kullanarak satıcı isimlerini, tarihleri, öğeleri, fiyatları ve toplamları fiş görüntülerinden doğru bir şekilde çıkarmanın, yerleşik görüntü ön işleme ve birden çok formatı destekleme ile nasıl yapılacağını gösterir.

Fiş Taramada IronOCR Neden Tercih Edilmeli?

IronOCR, taranmış belgelerden, görüntülerden ve PDF'lerden güvenilir metin çıkarımı sunan esnek bir OCR kütüphanesidir. Gelişmiş algoritmalar, bilgisayarlı görü ve makine öğrenimi modelleri ile IronOCR, zorlu senaryolarda bile yüksek doğruluğu garanti eder. Kütüphane, birden çok dili ve yazı tipi stilini destekler, böylece küresel uygulamalar için uygundur. IronOCR'u uygulamalarınıza dahil ederek, veri girişini ve metin analizini otomatikleştirebilir, verimliliği artırabilirsiniz.

IronOCR Fiş Görüntülerinden Metni Nasıl Çıkarır?

IronOCR, belgelerden, fotoğraflardan, ekran görüntülerinden ve canlı kamera beslemelerinden JSON yanıtları olarak metin alır. IronOCR, karmaşık algoritmalar ve makine öğrenimini kullanarak görüntü verilerini analiz eder, karakterleri tanır ve bunları makine tarafından okunabilir metne dönüştürür. Kütüphane, Tesseract 5 teknolojisini, üstün doğruluk için tescilli iyileştirmelerle birleştirir.

IronOCR Neden Fiş İşlemede Mükemmeldir?

IronOCR, düşük kaliteli taramaları, çeşitli fiş formatlarını ve farklı yönelimleri ele almakta mükemmeldir. Yerleşik görüntü ön işleme filtreleri, işleme başlamadan önce görüntü kalitesini otomatik olarak artırır, böylece buruşuk veya soluk fişlerden bile optimize sonuçlar sağlar.

IronOCR Kullanmak İçin Ne Gerekir?

IronOCR ile çalışmadan önce, bu ön koşulların yerinde olduğundan emin olun:

Hangi Geliştirme Ortamları Destekleniyor?

  1. Geliştirme Ortamı: Visual Studio gibi uygun bir IDE kurun. IronOCR, Windows, Linux, macOS, Azure ve AWS'i destekler.

Hangi Programlama Becerileri Gereklidir?

  1. C# Bilgisi: Temel C# bilgisi, kod örneklerini değiştirmenize yardımcı olur. IronOCR, basit örnekler ve API dokümantasyonu sağlar.

Hangi Yazılım Bağımlılıkları Gerekli?

  1. IronOCR Kurulumu: NuGet Paket Yöneticisi aracılığıyla yükleyin. Platforma özgü bağımlılıklar gerekebilir.

Lisansa Anahtarı Gerekli mi?

  1. Lisans Anahtarı (Opsiyonel): Ücretsiz deneme mevcuttur; üretim kullanımı bir lisans gerektirir.

Fiş Tarama İçin Visual Studio'da Yeni Bir Proje Nasıl Oluşturulur?

Visual Studio'da Yeni Bir Projeye Nasıl Başlatılır?

Visual Studio'yu açın ve Dosyalar'a gidin, ardından Yeni'ye gelin ve Proje'ye tıklayın.

 related to Visual Studio'da Yeni Bir Projeye Nasıl Başlatılır? Yeni Proje Görüntüsü

Hangi Proje Şablonunu Seçmeliyim?

Konsol Uygulaması'nı seçin ve İleri'ye tıklayın. Bu şablon, IronOCR'yi web uygulamalarına entegre etmeden önce öğrenmek için idealdir.

Visual Studio'nun 'Yeni bir proje oluştur' diyalogu, Windows, Linux ve macOS platform seçenekleriyle birlikte Konsol Uygulaması şablonunun seçildiğini gösteriyor Konsol Uygulaması

Fiş Tarayıcı Projeme Nasıl İsim Vermeliyim?

Proje adınızı ve yerini yazın, sonra İleri'ye tıklayın. ReceiptScannerAPI' gibi açıklayıcı bir isim seçin.

Visual Studio yeni proje yapılandırma ekranı, C# seçili ve çözüm ayarları görüntülenmiş 'IronOCR' adında bir Konsol Uygulaması oluşturmak için Proje Yapılandırması

Hangi .NET Framework Sürümünü Seçmeliyim?

.NET 5.0 veya daha sonraki sürümleri uyumluluk için seçin ve Oluştur'a tıklayın.

Visual Studio'nun 'Ek Bilgiler' diyalogu, hedef framework olarak .NET 5.0 seçili Konsol Uygulaması yapılandırmasını ve Linux, macOS, Windows ve Konsol için platform seçeneklerini gösteriyor Hedef Çerçeve

Projemde IronOCR'yi Nasıl Yüklerim?

İki basit yükleme yöntemi mevcuttur:

NuGet Paket Yöneticisi Yöntemini Nasıl Kullanırım?

Araçlar > NuGet Paket Yöneticisi > Çözüm için NuGet Paketlerini Yönet gidin

Visual Studio NuGet Paket Yöneticisi ayarları diyalog penceresi, paket kaynakları yapılandırması ve çözüm gezgininde C# proje yapısını gösteriyor NuGet Paket Yöneticisi

IronOCR'yi arayın ve paketi yükleyin. İngilizce olmayan fişler için dile özel paketleri yükleyin.

Visual Studio'da NuGet Paket Yöneticisi, Ana kütüphane ve Arapça, İbranice ve İspanyolca için dil bazlı OCR paketlerini içeren yüklü IronOCR paketlerini gösteriyor IronOCR

Komut Satırı Yükleme Nasıl Kullanılır?

  1. Araçlar > NuGet Paket Yöneticisi > Paket Yöneticisi Konsolu gidin
  2. Bu komutu girin:

    Install-Package IronOcr

    Visual Studio Paket Yöneticisi Konsolu penceresi, 'Create PDF' adında bir proje için '`Install-Package IronOcr`' NuGet komutunun çalıştırıldığını gösteriyor Paket Yöneticisi Konsolu

IronOCR ile Fiş Verilerini Hızla Nasıl Çıkarabilirim?

Sadece birkaç satır kodla fiş verilerini çıkarın:

  1. IronOCR aşağıdaki NuGet Paket Yöneticisi ile yükleyin

    PM > Install-Package IronOcr
  2. Bu kod parçacığını kopyalayın ve çalıştırın.

    using IronOcr;
    using System;
    
    var ocr = new IronTesseract();
    
    // Configure for receipt scanning
    ocr.Configuration.ReadBarCodes = true;
    ocr.Configuration.WhiteListCharacters = "0123456789.$,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz% ";
    
    using (var input = new OcrInput(@"receipt.jpg"))
    {
        // Apply automatic image enhancement
        input.DeNoise();
        input.Deskew();
        input.EnhanceResolution(225);
    
        // Extract text from receipt
        var result = ocr.Read(input);
    
        // Display extracted text and confidence
        Console.WriteLine($"Extracted Text:\n{result.Text}");
        Console.WriteLine($"\nConfidence: {result.Confidence}%");
    }
  3. Canlı ortamınızda test için dağıtım yapın

    Ücretsiz deneme ile bugün projenizde IronOCR kullanmaya başlayın

    arrow pointer

Fiş Görüntülerinden Yapılandırılmış Verileri Nasıl Çıkarırım?

IronOCR, çeşitli belge türlerinden satır öğeleri, fiyatlandırma, vergiler ve toplamları çıkartır. Kütüphane PDF'leri, çok sayfalı TIFF'leri ve çeşitli görüntü formatlarını destekler.

using IronOcr;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class ReceiptScanner
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure OCR for optimal receipt reading
        ocr.Configuration.WhiteListCharacters = "0123456789.$,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz% ";
        ocr.Configuration.BlackListCharacters = "~`@#*_}{][|\\";
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

        // Load the image of the receipt
        using (var input = new OcrInput(@"r2.png"))
        {
            // Apply image enhancement filters
            input.Deskew(); // Fix image rotation
            input.EnhanceResolution(225); // Optimal DPI for receipts
            input.DeNoise(); // Remove background noise
            input.Sharpen(); // Improve text clarity

            // Perform OCR on the input image
            var result = ocr.Read(input);

            // Regular expression patterns to extract relevant details from the OCR result
            var descriptionPattern = @"\w+\s+(.*?)\s+(\d+\.\d+)\s+Units\s+(\d+\.\d+)\s+Tax15%\s+\$(\d+\.\d+)";
            var pricePattern = @"\$\d+(\.\d{2})?";
            var datePattern = @"\d{1,2}[/-]\d{1,2}[/-]\d{2,4}";

            // Variables to store extracted data
            var descriptions = new List<string>();
            var unitPrices = new List<decimal>();
            var taxes = new List<decimal>();
            var amounts = new List<decimal>();

            var lines = result.Text.Split('\n');
            foreach (var line in lines)
            {
                // Match each line against the description pattern
                var descriptionMatch = Regex.Match(line, descriptionPattern);
                if (descriptionMatch.Success)
                {
                    descriptions.Add(descriptionMatch.Groups[1].Value.Trim());
                    unitPrices.Add(decimal.Parse(descriptionMatch.Groups[2].Value));

                    // Calculate tax and total amount for each item
                    var tax = unitPrices[unitPrices.Count - 1] * 0.15m;
                    taxes.Add(tax);
                    amounts.Add(unitPrices[unitPrices.Count - 1] + tax);
                }

                // Extract date if found
                var dateMatch = Regex.Match(line, datePattern);
                if (dateMatch.Success)
                {
                    Console.WriteLine($"Receipt Date: {dateMatch.Value}");
                }
            }

            // Output the extracted data
            for (int i = 0; i < descriptions.Count; i++)
            {
                Console.WriteLine($"Description: {descriptions[i]}");
                Console.WriteLine($"Quantity: 1.00 Units");
                Console.WriteLine($"Unit Price: ${unitPrices[i]:0.00}");
                Console.WriteLine($"Taxes: ${taxes[i]:0.00}");
                Console.WriteLine($"Amount: ${amounts[i]:0.00}");
                Console.WriteLine("-----------------------");
            }

            // Calculate and display totals
            var subtotal = unitPrices.Sum();
            var totalTax = taxes.Sum();
            var grandTotal = amounts.Sum();

            Console.WriteLine($"\nSubtotal: ${subtotal:0.00}");
            Console.WriteLine($"Total Tax: ${totalTax:0.00}");
            Console.WriteLine($"Grand Total: ${grandTotal:0.00}");
        }
    }
}
using IronOcr;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class ReceiptScanner
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure OCR for optimal receipt reading
        ocr.Configuration.WhiteListCharacters = "0123456789.$,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz% ";
        ocr.Configuration.BlackListCharacters = "~`@#*_}{][|\\";
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

        // Load the image of the receipt
        using (var input = new OcrInput(@"r2.png"))
        {
            // Apply image enhancement filters
            input.Deskew(); // Fix image rotation
            input.EnhanceResolution(225); // Optimal DPI for receipts
            input.DeNoise(); // Remove background noise
            input.Sharpen(); // Improve text clarity

            // Perform OCR on the input image
            var result = ocr.Read(input);

            // Regular expression patterns to extract relevant details from the OCR result
            var descriptionPattern = @"\w+\s+(.*?)\s+(\d+\.\d+)\s+Units\s+(\d+\.\d+)\s+Tax15%\s+\$(\d+\.\d+)";
            var pricePattern = @"\$\d+(\.\d{2})?";
            var datePattern = @"\d{1,2}[/-]\d{1,2}[/-]\d{2,4}";

            // Variables to store extracted data
            var descriptions = new List<string>();
            var unitPrices = new List<decimal>();
            var taxes = new List<decimal>();
            var amounts = new List<decimal>();

            var lines = result.Text.Split('\n');
            foreach (var line in lines)
            {
                // Match each line against the description pattern
                var descriptionMatch = Regex.Match(line, descriptionPattern);
                if (descriptionMatch.Success)
                {
                    descriptions.Add(descriptionMatch.Groups[1].Value.Trim());
                    unitPrices.Add(decimal.Parse(descriptionMatch.Groups[2].Value));

                    // Calculate tax and total amount for each item
                    var tax = unitPrices[unitPrices.Count - 1] * 0.15m;
                    taxes.Add(tax);
                    amounts.Add(unitPrices[unitPrices.Count - 1] + tax);
                }

                // Extract date if found
                var dateMatch = Regex.Match(line, datePattern);
                if (dateMatch.Success)
                {
                    Console.WriteLine($"Receipt Date: {dateMatch.Value}");
                }
            }

            // Output the extracted data
            for (int i = 0; i < descriptions.Count; i++)
            {
                Console.WriteLine($"Description: {descriptions[i]}");
                Console.WriteLine($"Quantity: 1.00 Units");
                Console.WriteLine($"Unit Price: ${unitPrices[i]:0.00}");
                Console.WriteLine($"Taxes: ${taxes[i]:0.00}");
                Console.WriteLine($"Amount: ${amounts[i]:0.00}");
                Console.WriteLine("-----------------------");
            }

            // Calculate and display totals
            var subtotal = unitPrices.Sum();
            var totalTax = taxes.Sum();
            var grandTotal = amounts.Sum();

            Console.WriteLine($"\nSubtotal: ${subtotal:0.00}");
            Console.WriteLine($"Total Tax: ${totalTax:0.00}");
            Console.WriteLine($"Grand Total: ${grandTotal:0.00}");
        }
    }
}
Imports IronOcr
Imports System
Imports System.Collections.Generic
Imports System.Text.RegularExpressions
Imports System.Linq

Class ReceiptScanner
    Shared Sub Main()
        Dim ocr = New IronTesseract()

        ' Configure OCR for optimal receipt reading
        ocr.Configuration.WhiteListCharacters = "0123456789.$,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz% "
        ocr.Configuration.BlackListCharacters = "~`@#*_}{][|\"
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5

        ' Load the image of the receipt
        Using input = New OcrInput("r2.png")
            ' Apply image enhancement filters
            input.Deskew() ' Fix image rotation
            input.EnhanceResolution(225) ' Optimal DPI for receipts
            input.DeNoise() ' Remove background noise
            input.Sharpen() ' Improve text clarity

            ' Perform OCR on the input image
            Dim result = ocr.Read(input)

            ' Regular expression patterns to extract relevant details from the OCR result
            Dim descriptionPattern = "\w+\s+(.*?)\s+(\d+\.\d+)\s+Units\s+(\d+\.\d+)\s+Tax15%\s+\$(\d+\.\d+)"
            Dim pricePattern = "\$\d+(\.\d{2})?"
            Dim datePattern = "\d{1,2}[/-]\d{1,2}[/-]\d{2,4}"

            ' Variables to store extracted data
            Dim descriptions = New List(Of String)()
            Dim unitPrices = New List(Of Decimal)()
            Dim taxes = New List(Of Decimal)()
            Dim amounts = New List(Of Decimal)()

            Dim lines = result.Text.Split(ControlChars.Lf)
            For Each line In lines
                ' Match each line against the description pattern
                Dim descriptionMatch = Regex.Match(line, descriptionPattern)
                If descriptionMatch.Success Then
                    descriptions.Add(descriptionMatch.Groups(1).Value.Trim())
                    unitPrices.Add(Decimal.Parse(descriptionMatch.Groups(2).Value))

                    ' Calculate tax and total amount for each item
                    Dim tax = unitPrices(unitPrices.Count - 1) * 0.15D
                    taxes.Add(tax)
                    amounts.Add(unitPrices(unitPrices.Count - 1) + tax)
                End If

                ' Extract date if found
                Dim dateMatch = Regex.Match(line, datePattern)
                If dateMatch.Success Then
                    Console.WriteLine($"Receipt Date: {dateMatch.Value}")
                End If
            Next

            ' Output the extracted data
            For i As Integer = 0 To descriptions.Count - 1
                Console.WriteLine($"Description: {descriptions(i)}")
                Console.WriteLine("Quantity: 1.00 Units")
                Console.WriteLine($"Unit Price: ${unitPrices(i):0.00}")
                Console.WriteLine($"Taxes: ${taxes(i):0.00}")
                Console.WriteLine($"Amount: ${amounts(i):0.00}")
                Console.WriteLine("-----------------------")
            Next

            ' Calculate and display totals
            Dim subtotal = unitPrices.Sum()
            Dim totalTax = taxes.Sum()
            Dim grandTotal = amounts.Sum()

            Console.WriteLine(vbCrLf & $"Subtotal: ${subtotal:0.00}")
            Console.WriteLine($"Total Tax: ${totalTax:0.00}")
            Console.WriteLine($"Grand Total: ${grandTotal:0.00}")
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

Fiş Tarama Doğruluğunu Hangi Teknikler Arttırır?

Doğru fiş tarama için anahtar teknikler:

Visual Studio hata ayıklama konsolu, bir PDF'den çıkarılan fatura verilerini gösteriyor, açıklamalar, miktarlar, fiyatlar, vergiler ve toplamlar ile öğeler görüntüleniyor Çıktı

Fişin Tüm İçeriğini Nasıl Çıkarırım?

Biçimlendirme korunduğunda tam fiş içeriğini çıkarın:

using IronOcr;
using System;
using System.Linq;

class WholeReceiptExtractor
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure for receipt scanning
        ocr.Configuration.ReadBarCodes = true; // Enable barcode detection
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5; // Use latest engine
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm; // Best accuracy

        using (var input = new OcrInput(@"r3.png"))
        {
            // Apply automatic image correction
            input.WithTitle("Receipt Scan");

            // Use computer vision to find text regions
            var textRegions = input.FindTextRegions();
            Console.WriteLine($"Found {textRegions.Count()} text regions");

            // Apply optimal filters for receipt processing
            input.ApplyOcrInputFilters();

            // Perform OCR on the entire receipt
            var result = ocr.Read(input);

            // Display extracted text
            Console.WriteLine("=== EXTRACTED RECEIPT TEXT ===");
            Console.WriteLine(result.Text);

            // Get detailed results
            Console.WriteLine($"\n=== OCR STATISTICS ===");
            Console.WriteLine($"OCR Confidence: {result.Confidence:F2}%");
            Console.WriteLine($"Pages Processed: {result.Pages.Length}");
            Console.WriteLine($"Paragraphs Found: {result.Paragraphs.Length}");
            Console.WriteLine($"Lines Detected: {result.Lines.Length}");
            Console.WriteLine($"Words Recognized: {result.Words.Length}");

            // Extract any barcodes found
            if (result.Barcodes.Any())
            {
                Console.WriteLine("\n=== BARCODES DETECTED ===");
                foreach(var barcode in result.Barcodes)
                {
                    Console.WriteLine($"Type: {barcode.Type}");
                    Console.WriteLine($"Value: {barcode.Value}");
                    Console.WriteLine($"Location: X={barcode.X}, Y={barcode.Y}");
                }
            }

            // Save as searchable PDF
            result.SaveAsSearchablePdf("receipt_searchable.pdf");
            Console.WriteLine("\nSearchable PDF saved as: receipt_searchable.pdf");

            // Export as hOCR for preservation
            result.SaveAsHocrFile("receipt_hocr.html");
            Console.WriteLine("hOCR file saved as: receipt_hocr.html");
        }
    }
}
using IronOcr;
using System;
using System.Linq;

class WholeReceiptExtractor
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure for receipt scanning
        ocr.Configuration.ReadBarCodes = true; // Enable barcode detection
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5; // Use latest engine
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm; // Best accuracy

        using (var input = new OcrInput(@"r3.png"))
        {
            // Apply automatic image correction
            input.WithTitle("Receipt Scan");

            // Use computer vision to find text regions
            var textRegions = input.FindTextRegions();
            Console.WriteLine($"Found {textRegions.Count()} text regions");

            // Apply optimal filters for receipt processing
            input.ApplyOcrInputFilters();

            // Perform OCR on the entire receipt
            var result = ocr.Read(input);

            // Display extracted text
            Console.WriteLine("=== EXTRACTED RECEIPT TEXT ===");
            Console.WriteLine(result.Text);

            // Get detailed results
            Console.WriteLine($"\n=== OCR STATISTICS ===");
            Console.WriteLine($"OCR Confidence: {result.Confidence:F2}%");
            Console.WriteLine($"Pages Processed: {result.Pages.Length}");
            Console.WriteLine($"Paragraphs Found: {result.Paragraphs.Length}");
            Console.WriteLine($"Lines Detected: {result.Lines.Length}");
            Console.WriteLine($"Words Recognized: {result.Words.Length}");

            // Extract any barcodes found
            if (result.Barcodes.Any())
            {
                Console.WriteLine("\n=== BARCODES DETECTED ===");
                foreach(var barcode in result.Barcodes)
                {
                    Console.WriteLine($"Type: {barcode.Type}");
                    Console.WriteLine($"Value: {barcode.Value}");
                    Console.WriteLine($"Location: X={barcode.X}, Y={barcode.Y}");
                }
            }

            // Save as searchable PDF
            result.SaveAsSearchablePdf("receipt_searchable.pdf");
            Console.WriteLine("\nSearchable PDF saved as: receipt_searchable.pdf");

            // Export as hOCR for preservation
            result.SaveAsHocrFile("receipt_hocr.html");
            Console.WriteLine("hOCR file saved as: receipt_hocr.html");
        }
    }
}
Imports IronOcr
Imports System
Imports System.Linq

Class WholeReceiptExtractor
    Shared Sub Main()
        Dim ocr = New IronTesseract()

        ' Configure for receipt scanning
        ocr.Configuration.ReadBarCodes = True ' Enable barcode detection
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5 ' Use latest engine
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm ' Best accuracy

        Using input = New OcrInput("r3.png")
            ' Apply automatic image correction
            input.WithTitle("Receipt Scan")

            ' Use computer vision to find text regions
            Dim textRegions = input.FindTextRegions()
            Console.WriteLine($"Found {textRegions.Count()} text regions")

            ' Apply optimal filters for receipt processing
            input.ApplyOcrInputFilters()

            ' Perform OCR on the entire receipt
            Dim result = ocr.Read(input)

            ' Display extracted text
            Console.WriteLine("=== EXTRACTED RECEIPT TEXT ===")
            Console.WriteLine(result.Text)

            ' Get detailed results
            Console.WriteLine(vbCrLf & "=== OCR STATISTICS ===")
            Console.WriteLine($"OCR Confidence: {result.Confidence:F2}%")
            Console.WriteLine($"Pages Processed: {result.Pages.Length}")
            Console.WriteLine($"Paragraphs Found: {result.Paragraphs.Length}")
            Console.WriteLine($"Lines Detected: {result.Lines.Length}")
            Console.WriteLine($"Words Recognized: {result.Words.Length}")

            ' Extract any barcodes found
            If result.Barcodes.Any() Then
                Console.WriteLine(vbCrLf & "=== BARCODES DETECTED ===")
                For Each barcode In result.Barcodes
                    Console.WriteLine($"Type: {barcode.Type}")
                    Console.WriteLine($"Value: {barcode.Value}")
                    Console.WriteLine($"Location: X={barcode.X}, Y={barcode.Y}")
                Next
            End If

            ' Save as searchable PDF
            result.SaveAsSearchablePdf("receipt_searchable.pdf")
            Console.WriteLine(vbCrLf & "Searchable PDF saved as: receipt_searchable.pdf")

            ' Export as hOCR for preservation
            result.SaveAsHocrFile("receipt_hocr.html")
            Console.WriteLine("hOCR file saved as: receipt_hocr.html")
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

Visual Studio hata ayıklama konsolu, bir PDF'den çıkarılan fatura verilerini gösteriyor, açıklamalar, miktarlar, fiyatlar, vergiler ve toplamlar ile öğeler görüntüleniyor Fiş tarama API çıktısı

Gelişmiş Özellikler Fiş Tarama Nasıl İyileştirir?

IronOCR, fiş tarama doğruluğunu önemli ölçüde artıran birkaç gelişmiş özellik sunar:

IronOCR Hangi Dilleri Destekler?

  1. Çoklu Dil Desteği: 125'ten fazla dilde veya bir belgede birden çok dilde fişleri işleyin.

IronOCR Fişlerdeki Barkodları Okuyabilir mi?

  1. Barkod Okuma: barkodları ve QR kodları otomatik olarak tespit eder ve okur.

Bilgisayarlı Görüntüleme Fiş İşlemeye Nasıl Yardımcı Olur?

  1. Bilgisayarlı Görüntüleme: OCR öncesi metin bölgelerini bulmak için gelişmiş metin tespiti kullanın.

Özgün Fiş Formatları İçin Özel Modeller Eğitebilir miyim?

  1. Özel Eğitim: Özelleştirilmiş fiş biçimleri için özel yazı tiplerini eğitin.

Toplu İşlem İçin Performansı Nasıl İyileştirebilirim?

  1. Performans Optimizasyonu: Toplu işlemler için çoklu iş parçacığı ve asenkron işleme uygulayın.
// Example: Async receipt processing for high-volume scenarios
using IronOcr;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.IO;

class BulkReceiptProcessor
{
    static async Task Main()
    {
        var ocr = new IronTesseract();

        // Configure for optimal performance
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
        ocr.Configuration.UseMultiThreading = true;
        ocr.Configuration.ProcessorCount = Environment.ProcessorCount;

        // Process multiple receipts asynchronously
        var receiptFiles = Directory.GetFiles(@"C:\Receipts\", "*.jpg");
        var tasks = new List<Task<OcrResult>>();

        foreach (var file in receiptFiles)
        {
            tasks.Add(ProcessReceiptAsync(ocr, file));
        }

        // Wait for all receipts to be processed
        var results = await Task.WhenAll(tasks);

        // Aggregate results
        decimal totalAmount = 0;
        foreach (var result in results)
        {
            // Extract total from each receipt
            var match = System.Text.RegularExpressions.Regex.Match(
                result.Text, @"Total:?\s*\$?(\d+\.\d{2})");

            if (match.Success && decimal.TryParse(match.Groups[1].Value, out var amount))
            {
                totalAmount += amount;
            }
        }

        Console.WriteLine($"Processed {results.Length} receipts");
        Console.WriteLine($"Combined total: ${totalAmount:F2}");
    }

    static async Task<OcrResult> ProcessReceiptAsync(IronTesseract ocr, string filePath)
    {
        using (var input = new OcrInput(filePath))
        {
            // Apply preprocessing
            input.DeNoise();
            input.Deskew();
            input.EnhanceResolution(200);

            // Process asynchronously
            return await ocr.ReadAsync(input);
        }
    }
}
// Example: Async receipt processing for high-volume scenarios
using IronOcr;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.IO;

class BulkReceiptProcessor
{
    static async Task Main()
    {
        var ocr = new IronTesseract();

        // Configure for optimal performance
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
        ocr.Configuration.UseMultiThreading = true;
        ocr.Configuration.ProcessorCount = Environment.ProcessorCount;

        // Process multiple receipts asynchronously
        var receiptFiles = Directory.GetFiles(@"C:\Receipts\", "*.jpg");
        var tasks = new List<Task<OcrResult>>();

        foreach (var file in receiptFiles)
        {
            tasks.Add(ProcessReceiptAsync(ocr, file));
        }

        // Wait for all receipts to be processed
        var results = await Task.WhenAll(tasks);

        // Aggregate results
        decimal totalAmount = 0;
        foreach (var result in results)
        {
            // Extract total from each receipt
            var match = System.Text.RegularExpressions.Regex.Match(
                result.Text, @"Total:?\s*\$?(\d+\.\d{2})");

            if (match.Success && decimal.TryParse(match.Groups[1].Value, out var amount))
            {
                totalAmount += amount;
            }
        }

        Console.WriteLine($"Processed {results.Length} receipts");
        Console.WriteLine($"Combined total: ${totalAmount:F2}");
    }

    static async Task<OcrResult> ProcessReceiptAsync(IronTesseract ocr, string filePath)
    {
        using (var input = new OcrInput(filePath))
        {
            // Apply preprocessing
            input.DeNoise();
            input.Deskew();
            input.EnhanceResolution(200);

            // Process asynchronously
            return await ocr.ReadAsync(input);
        }
    }
}
Imports IronOcr
Imports System
Imports System.Threading.Tasks
Imports System.Collections.Generic
Imports System.IO
Imports System.Text.RegularExpressions

Module BulkReceiptProcessor

    Sub Main()
        MainAsync().GetAwaiter().GetResult()
    End Sub

    Private Async Function MainAsync() As Task
        Dim ocr As New IronTesseract()

        ' Configure for optimal performance
        ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
        ocr.Configuration.UseMultiThreading = True
        ocr.Configuration.ProcessorCount = Environment.ProcessorCount

        ' Process multiple receipts asynchronously
        Dim receiptFiles = Directory.GetFiles("C:\Receipts\", "*.jpg")
        Dim tasks As New List(Of Task(Of OcrResult))()

        For Each file In receiptFiles
            tasks.Add(ProcessReceiptAsync(ocr, file))
        Next

        ' Wait for all receipts to be processed
        Dim results = Await Task.WhenAll(tasks)

        ' Aggregate results
        Dim totalAmount As Decimal = 0
        For Each result In results
            ' Extract total from each receipt
            Dim match = Regex.Match(result.Text, "Total:?\s*\$?(\d+\.\d{2})")

            If match.Success AndAlso Decimal.TryParse(match.Groups(1).Value, totalAmount) Then
                totalAmount += totalAmount
            End If
        Next

        Console.WriteLine($"Processed {results.Length} receipts")
        Console.WriteLine($"Combined total: ${totalAmount:F2}")
    End Function

    Private Async Function ProcessReceiptAsync(ocr As IronTesseract, filePath As String) As Task(Of OcrResult)
        Using input As New OcrInput(filePath)
            ' Apply preprocessing
            input.DeNoise()
            input.Deskew()
            input.EnhanceResolution(200)

            ' Process asynchronously
            Return Await ocr.ReadAsync(input)
        End Using
    End Function

End Module
$vbLabelText   $csharpLabel

Ortak Fiş Tarama Zorluklarını Nasıl Yönetirim?

Fiş tarama, IronOCR'nin üstesinden gelmenize yardımcı olduğu benzersiz zorluklar sunar:

Düşük Kaliteli Fiş Görüntüleriyle Nasıl Başa Çıkarım?

  • Düşük Kaliteli Görüntüler: Filtre Sihirbazı kullanarak otomatik olarak en iyi ön işleme ayarlarını bulun.

Eğimli veya Döndürülmüş Fişlere Ne Yapmalı?

Solmuş veya Düşük Kontrastlı Fişleri Nasıl İşlerim?

IronOCR Kırışık veya Hasarlı Fişleri İşleyebilir mi?

Farklı Fiş Formatları ve Düzenlerini Nasıl Yönetirim?

Fiş formatları, perakendeciler arasında çok değişkenlik gösterir. IronOCR esnek yaklaşımlar sunar:

using IronOcr;
using System;
using System.Collections.Generic;
using System.Linq;

class ReceiptLayoutHandler
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure for different receipt layouts
        ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd;
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;

        using (var input = new OcrInput(@"complex_receipt.jpg"))
        {
            // Apply region-specific processing
            var cropRegion = new CropRectangle(x: 0, y: 100, width: 400, height: 800);
            input.AddImage(@"complex_receipt.jpg", cropRegion);

            // Process with confidence tracking
            var result = ocr.Read(input);

            // Parse using confidence scores
            var highConfidenceLines = result.Lines
                .Where(line => line.Confidence > 85)
                .Select(line => line.Text)
                .ToList();

            // Extract data with fallback strategies
            var total = ExtractTotal(highConfidenceLines) 
                        ?? ExtractTotalAlternative(result.Text);

            Console.WriteLine($"Receipt Total: {total}");
        }
    }

    static decimal? ExtractTotal(List<string> lines)
    {
        // Primary extraction method
        foreach (var line in lines)
        {
            if (line.Contains("TOTAL") && 
                System.Text.RegularExpressions.Regex.IsMatch(line, @"\d+\.\d{2}"))
            {
                var match = System.Text.RegularExpressions.Regex.Match(line, @"(\d+\.\d{2})");
                if (decimal.TryParse(match.Value, out var total))
                    return total;
            }
        }
        return null;
    }

    static decimal? ExtractTotalAlternative(string fullText)
    {
        // Fallback extraction method
        var pattern = @"(?:Total|TOTAL|Grand Total|Amount Due).*?(\d+\.\d{2})";
        var match = System.Text.RegularExpressions.Regex.Match(fullText, pattern);

        if (match.Success && decimal.TryParse(match.Groups[1].Value, out var total))
            return total;

        return null;
    }
}
using IronOcr;
using System;
using System.Collections.Generic;
using System.Linq;

class ReceiptLayoutHandler
{
    static void Main()
    {
        var ocr = new IronTesseract();

        // Configure for different receipt layouts
        ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd;
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;

        using (var input = new OcrInput(@"complex_receipt.jpg"))
        {
            // Apply region-specific processing
            var cropRegion = new CropRectangle(x: 0, y: 100, width: 400, height: 800);
            input.AddImage(@"complex_receipt.jpg", cropRegion);

            // Process with confidence tracking
            var result = ocr.Read(input);

            // Parse using confidence scores
            var highConfidenceLines = result.Lines
                .Where(line => line.Confidence > 85)
                .Select(line => line.Text)
                .ToList();

            // Extract data with fallback strategies
            var total = ExtractTotal(highConfidenceLines) 
                        ?? ExtractTotalAlternative(result.Text);

            Console.WriteLine($"Receipt Total: {total}");
        }
    }

    static decimal? ExtractTotal(List<string> lines)
    {
        // Primary extraction method
        foreach (var line in lines)
        {
            if (line.Contains("TOTAL") && 
                System.Text.RegularExpressions.Regex.IsMatch(line, @"\d+\.\d{2}"))
            {
                var match = System.Text.RegularExpressions.Regex.Match(line, @"(\d+\.\d{2})");
                if (decimal.TryParse(match.Value, out var total))
                    return total;
            }
        }
        return null;
    }

    static decimal? ExtractTotalAlternative(string fullText)
    {
        // Fallback extraction method
        var pattern = @"(?:Total|TOTAL|Grand Total|Amount Due).*?(\d+\.\d{2})";
        var match = System.Text.RegularExpressions.Regex.Match(fullText, pattern);

        if (match.Success && decimal.TryParse(match.Groups[1].Value, out var total))
            return total;

        return null;
    }
}
Imports IronOcr
Imports System
Imports System.Collections.Generic
Imports System.Linq

Class ReceiptLayoutHandler
    Shared Sub Main()
        Dim ocr = New IronTesseract()

        ' Configure for different receipt layouts
        ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd
        ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm

        Using input = New OcrInput("complex_receipt.jpg")
            ' Apply region-specific processing
            Dim cropRegion = New CropRectangle(x:=0, y:=100, width:=400, height:=800)
            input.AddImage("complex_receipt.jpg", cropRegion)

            ' Process with confidence tracking
            Dim result = ocr.Read(input)

            ' Parse using confidence scores
            Dim highConfidenceLines = result.Lines _
                .Where(Function(line) line.Confidence > 85) _
                .Select(Function(line) line.Text) _
                .ToList()

            ' Extract data with fallback strategies
            Dim total = ExtractTotal(highConfidenceLines) _
                        OrElse ExtractTotalAlternative(result.Text)

            Console.WriteLine($"Receipt Total: {total}")
        End Using
    End Sub

    Shared Function ExtractTotal(lines As List(Of String)) As Decimal?
        ' Primary extraction method
        For Each line In lines
            If line.Contains("TOTAL") AndAlso _
                System.Text.RegularExpressions.Regex.IsMatch(line, "\d+\.\d{2}") Then
                Dim match = System.Text.RegularExpressions.Regex.Match(line, "(\d+\.\d{2})")
                Dim total As Decimal
                If Decimal.TryParse(match.Value, total) Then
                    Return total
                End If
            End If
        Next
        Return Nothing
    End Function

    Shared Function ExtractTotalAlternative(fullText As String) As Decimal?
        ' Fallback extraction method
        Dim pattern = "(?:Total|TOTAL|Grand Total|Amount Due).*?(\d+\.\d{2})"
        Dim match = System.Text.RegularExpressions.Regex.Match(fullText, pattern)

        Dim total As Decimal
        If match.Success AndAlso Decimal.TryParse(match.Groups(1).Value, total) Then
            Return total
        End If

        Return Nothing
    End Function
End Class
$vbLabelText   $csharpLabel

Fiş Tarama API'leri Hakkında Unutulmaması Gereken Anahtar Noktalar Nelerdir?

IronOCR gibi fiş tarama API'leri, fişlerden veri çıkarımı otomasyonu için güvenilir çözümler sunar. İleri düzey OCR teknolojisi kullanarak işletmeler otomatik olarak satıcı isimlerini, satın alma tarihlerini, madde listelerini, fiyatları, vergileri ve toplamları çıkarabilir. Birden çok dil, para birimi ve barkod desteği ile işletmeler, fiş yönetimini basitleştirebilir, zaman tasarrufu yapabilir ve veri odaklı kararlar alabilir.

IronOCR, görev otomasyonu ve geliştirilmiş verimlilik sağlayarak geliştiricilerin doğru ve verimli metin çıkarması için gerekli araçları sağlar. Kütüphanenin tam özellik seti, çeşitli belge türleri için destek ve %98 hafıza azaltımı gibi son iyileştirmeleri içerir.

Önkoşulları karşılayarak ve IronOCR'yi entegre ederek, otomatik fiş işleme faydalarını açığa çıkarabilirsiniz. Kütüphanenin belgeleri, örnekleri ve hata giderme kılavuzları sorunsuz bir uygulama sağlar.

Daha fazla bilgi için, lisanslama sayfasını ziyaret edin veya C# Tesseract OCR öğreticisini keşfedin.

Sıkça Sorulan Sorular

C#'da OCR kullanarak fiş veri çıkarımını otomatikleştirebilirim?

C#'da IronOCR kullanarak fiş veri çıkarımını otomatikleştirebilirsiniz; bu da fiş görüntülerinden anahtar detaylar, sırayla maddeler, fiyatlar, vergiler ve toplam tutarlar çıkarma imkanı sağlar.

C#'da bir fiş tarama projesi kurma için ön koşullar nelerdir?

C#'da bir fiş tarama projesi kurmak için Visual Studio, temel C# programlama bilgisi ve projenizde IronOCR kütüphanesi kurulmalıdır.

Visual Studio'da NuGet Paket Yöneticisini kullanarak OCR kütüphanesi nasıl kurulur?

Visual Studio'yu açın ve Araçlar > NuGet Paket Yöneticisi > Çözüm için NuGet Paketlerini Yönet'e gidin, IronOCR'u arayın ve projenize kurun.

OCR kütüphanesi Visual Studio Komut Satırı kullanılarak kurulabilir mi?

Evet, Visual Studio'da Paket Yöneticisi Konsolunu açarak ve şu komutu çalıştırarak IronOCR'u kurabilirsiniz: Install-Package IronOcr.

Bütün bir fişten metin nasıl çıkarılır?

Bir fişten bütün metni çıkarmak için, IronOCR'u kullanarak tüm fiş görüntüsüne OCR uygulayın ve ardından çıkarılan metni C# kodu ile çıktılar.

Bir fiş tarama API'si hangi faydaları sağlar?

Bir fiş tarama API'si, IronOCR gibi, veri çıkarımını otomatikleştirir, manuel hataları en aza indirir, üretkenliği artırır ve daha iyi iş kararları için harcama kalıplarına dair içgörüler sağlar.

OCR kütüphanesi çok dilli ve çok para birimli destek sağlar mı?

Evet, IronOCR, çoklu dilleri, para birimlerini ve fiş formatlarını destekler ve bu da onu küresel uygulamalar için ideal yapar.

OCR kütüphanesi metin seçimi konusunda ne kadar doğru?

IronOCR, ileri düzey OCR algoritmaları, bilgisayarlı görü ve makine öğrenme modelleri kullanarak metin seçiminde yüksek doğruluk sağlar, zorlu senaryolarda bile.

OCR kullanarak fişlerden hangi tür veriler çıkarılabilir?

IronOCR, kalem maddeleri, fiyatlandırma, vergi miktarları, toplam miktarlar ve diğer fiş detayları gibi veriler çıkarabilir.

Fiş ayrıştırmayı otomatikleştirmek iş süreçlerini nasıl iyileştirebilir?

IronOCR ile fiş ayrıştırmayı otomatikleştirmek, manuel girdiyi azaltarak iş süreçlerini iyileştirir, doğru veri toplama ve veri odaklı karar verme imkanı tanır.

Curtis Chau
Teknik Yazar

Curtis 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ı...

Daha Fazla Oku

Iron Destek Ekibi

Haftada 5 gün, 24 saat çevrimiçiyiz.
Sohbet
E-posta
Beni Ara