푸터 콘텐츠로 바로가기
IRONOCR 사용

영수증 스캔 API: C# 및 IronOCR 을 사용하여 영수증에서 데이터 추출

영수증 스캔 API는 OCR 기술을 사용하여 영수증에서 데이터 추출을 자동화함으로써 수작업 입력 오류를 크게 줄이고 처리 속도를 높여 줍니다. 본 가이드는 C#에서 IronOCR를 사용하여 이미지 전처리 및 다양한 형식 지원을 통해 영수증 이미지에서 공급자 이름, 날짜, 항목, 가격 및 합계를 정확하게 추출하는 방법을 보여줍니다.

영수증 스캔에 IronOCR을 선택하는 이유는 무엇입니까?

IronOCR은 스캔된 문서, 이미지 및 PDF에서 신뢰할 수 있는 텍스트 추출을 제공하는 유연한 OCR 라이브러리입니다. 고급 알고리즘, 컴퓨터 비전 및 기계 학습 모델을 통해, IronOCR은 까다로운 시나리오에서도 높은 정확성을 보장합니다. 이 라이브러리는 다양한 언어와 글꼴 스타일을 지원하므로, 글로벌 응용 프로그램에 적합합니다. IronOCR를 귀사의 응용 프로그램에 통합함으로써, 데이터 입력 및 텍스트 분석을 자동화하여 생산성을 높일 수 있습니다.

IronOCR은 영수증 이미지에서 어떻게 텍스트를 추출합니까?

IronOCR은 문서, 사진, 스크린샷 및 라이브 카메라 피드에서 텍스트를 JSON 응답으로 가져옵니다. 정교한 알고리즘과 기계 학습을 사용하여, IronOCR은 이미지 데이터를 분석하고 문자 인식을 수행하여 기계가 읽을 수 있는 텍스트로 변환합니다. 도서관은 Tesseract 5 기술을 사용하여, 고유의 개선으로 정확도를 향상시킵니다.

IronOCR는 영수증 처리에 왜 탁월할까요?

IronOCR는 저품질 스캔, 다양한 영수증 포맷 및 다른 방향의 처리에서 우수한 성능을 발휘합니다. 내장된 이미지 전처리 필터는 처리 전에 자동으로 이미지 품질을 향상시켜, 구김이 있거나 바랜 영수증에서도 최적의 결과를 보장합니다.

IronOCR를 사용하기 위해 무엇이 필요한가요?

IronOCR 작업을 시작하기 전에 이러한 전제조건이 충족되어 있는지 확인하세요:

지원되는 개발 환경은 무엇인가요?

  1. 개발 환경: Visual Studio와 같은 적절한 IDE를 설치하세요. IronOCR는 Windows, Linux, macOS, Azure, 및 AWS를 지원합니다.

필요한 프로그래밍 기술은 무엇인가요?

  1. C# 지식: 기본적인 C# 이해는 코드 예제를 수정하는 데 도움이 됩니다. IronOCR는 간단한 예제API 문서를 제공합니다.

필요한 소프트웨어 종속성은 무엇인가요?

  1. IronOCR 설치: NuGet Package Manager를 통해 설치하세요. 플랫폼 별 종속성이 요구될 수 있습니다.

라이선스 키가 필요한가요?

  1. 라이선스 키 (선택 사항): 무료 체험판 사용 가능; 프로덕션 사용에는 라이선스가 필요합니다.

영수증 스캐닝을 위한 새로운 Visual Studio 프로젝트는 어떻게 만드나요?

Visual Studio에서 새 프로젝트를 어떻게 시작하나요?

Visual Studio를 열고 파일로 이동한 다음 새로 만들기 위에 커서를 올리고 프로젝트를 클릭합니다.

 related to Visual Studio에서 새 프로젝트를 어떻게 시작하나요? 새 프로젝트 이미지

어떤 프로젝트 템플릿을 선택해야 하나요?

콘솔 애플리케이션을 선택하고 다음을 클릭하세요. 이 템플릿은 웹 애플리케이션에 구현하기 전에 IronOCR를 배우기에 이상적입니다.

콘솔 애플리케이션 템플릿이 선택된 Visual Studio의 '새 프로젝트 만들기' 대화 상자와 Windows, Linux, macOS에 대한 플랫폼 옵션이 표시됨 콘솔 응용 프로그램

영수증 스캐너 프로젝트 이름은 어떻게 정해야 하나요?

프로젝트 이름과 위치를 작성한 후 다음을 클릭하세요. "ReceiptScannerAPI" 같은 설명적인 이름을 선택하세요.

C#가 선택된 상태의 'IronOCR'라는 콘솔 애플리케이션을 생성하기 위한 Visual Studio 새 프로젝트 구성 화면 및 솔루션 설정 프로젝트 구성

어떤 .NET Framework 버전을 선택해야 하나요?

.NET 5.0 이상을 선택하여 최적의 호환성을 확보한 뒤 생성 버튼을 클릭하세요.

.NET 5.0이 대상 프레임워크로 선택되고 Linux, macOS, Windows 및 콘솔에 대한 플랫폼 옵션이 표시된 Visual Studio의 '추가 정보' 대화 상자 대상 프레임워크

내 프로젝트에 IronOCR를 설치하려면 어떻게 해야 하나요?

두 가지 간단한 설치 방법을 사용할 수 있습니다:

NuGet Package Manager 방법은 어떻게 사용하나요?

도구 > NuGet 패키지 매니저 > 솔루션용 NuGet 패키지 관리로 이동하세요

패키지 소스 구성이 포함된 Visual Studio NuGet 패키지 관리자 설정 대화 상자와 솔루션 탐색기에서의 C# 프로젝트 구조 NuGet 패키지 매니저

IronOCR를 검색하여 패키지를 설치하세요. 비 영어 영수증의 경우, 언어별 패키지를 설치하세요.

Visual Studio의 NuGet 패키지 관리자에 설치된 IronOCR 패키지 및 아랍어, 히브리어, 스페인어용 언어별 OCR 패키지가 표시됨 IronOCR

명령줄 설치 방법은 어떻게 사용하나요?

  1. 도구 > NuGet 패키지 매니저 > Package Manager Console로 이동하세요
  2. 이 명령을 입력하세요:

    Install-Package IronOcr

     related to 명령줄 설치 방법은 어떻게 사용하나요? Package Manager Console

IronOCR로 영수증 데이터를 신속하게 추출하려면 어떻게 해야 하나요?

몇 줄의 코드로 영수증 데이터를 추출하세요:

  1. NuGet 패키지 관리자를 사용하여 https://www.nuget.org/packages/IronOcr 설치하기

    PM > Install-Package IronOcr
  2. 다음 코드 조각을 복사하여 실행하세요.

    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. 실제 운영 환경에서 테스트할 수 있도록 배포하세요.

    무료 체험판으로 오늘 프로젝트에서 IronOCR 사용 시작하기

    arrow pointer

영수증 이미지에서 구조화된 데이터를 어떻게 추출하나요?

IronOCR는 다양한 문서 유형에서 항목별 정보, 가격, 세금 및 총액을 추출합니다. 이 라이브러리는 PDF, 다중 페이지 TIFF, 다양한 이미지 형식을 지원합니다.

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}");
        }
    }
}
$vbLabelText   $csharpLabel

영수증 스캔 정확성을 향상시키는 기술은 무엇입니까?

정확한 영수증 스캔을 위한 핵심 기술:

항목 설명, 수량, 가격, 세금, 총액을 보여주는 PDF에서 추출된 송장 데이터를 표시하는 Visual Studio 디버그 콘솔 산출

전체 영수증 내용을 추출하려면 어떻게 해야 합니까?

형식을 유지하면서 전체 영수증 내용을 추출:

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");
        }
    }
}
$vbLabelText   $csharpLabel

항목 설명, 수량, 가격, 세금, 총액을 보여주는 PDF에서 추출된 송장 데이터를 표시하는 Visual Studio 디버그 콘솔 영수증 API 출력 스캔

영수증 스캔을 향상시키는 고급 기능은 무엇입니까?

IronOCR는 영수증 스캔 정확성을 크게 향상시키는 여러 고급 기능을 제공합니다:

IronOCR는 어떤 언어를 지원합니까?

  1. 다국어 지원: 125개 이상의 언어 또는 한 문서 내에서 여러 언어로 영수증을 처리합니다.

IronOCR가 영수증에서 바코드를 읽을 수 있습니까?

  1. 바코드 읽기: 바코드 및 QR 코드를 자동으로 감지하고 읽습니다.

컴퓨터 비전 기술이 영수증 처리에 어떻게 도움이 됩니까?

  1. 컴퓨터 비전: 고급 텍스트 감지를 사용하여 OCR 이전에 텍스트 영역을 찾습니다.

특이한 영수증 형식을 위한 맞춤형 모델을 훈련할 수 있습니까?

  1. 맞춤형 훈련: 특별한 영수증 형식을 위한 사용자 정의 글꼴 훈련

대량 처리 성능을 향상시키려면 어떻게 해야 합니까?

  1. 성능 최적화: 대량 작업에 멀티스레딩비동기 처리 구현
// 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);
        }
    }
}
$vbLabelText   $csharpLabel

일반적인 영수증 스캔 문제를 어떻게 처리합니까?

영수증 스캔은 IronOCR가 해결하는 고유한 문제를 제공합니다:

품질이 낮은 영수증 이미지는 어떻게 처리합니까?

  • 품질이 낮은 이미지: 필터 마법사를 사용하여 최적의 전처리 설정을 자동으로 찾습니다.

기울어지거나 회전된 영수증은 어떻게 처리합니까?

흐리거나 대비가 낮은 영수증을 어떻게 처리합니까?

손상된 영수증을 IronOCR가 처리할 수 있습니까?

  • 구겨지거나 손상된 영수증: 고급 전처리로 어려운 이미지에서 텍스트 복구

다양한 영수증 형식 및 레이아웃을 어떻게 관리합니까?

영수증 형식은 소매업체 간에 크게 다릅니다. IronOCR는 유연한 접근 방식을 제공합니다:

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;
    }
}
$vbLabelText   $csharpLabel

영수증 스캔 API에 대해 기억해야 할 주요 내용을 무엇입니까?

IronOCR와 같은 영수증 스캔 API는 영수증에서 데이터 추출을 자동화하는 신뢰할 수 있는 솔루션을 제공합니다. 고급 OCR 기술을 사용하여 사업체는 자동으로 판매자 이름, 구매 날짜, 항목 목록, 가격, 세금 및 총액을 추출할 수 있습니다. 여러 언어, 통화 및 바코드 지원을 지원하여 기업은 영수증 관리를 간소화하고 시간을 절약하며 데이터 기반 의사 결정을 할 수 있습니다.

IronOCR는 개발자가 정확하고 효율적인 텍스트 추출이 가능하도록 필요한 도구를 제공하며, 작업 자동화 및 개선된 효율성을 지원합니다. 도서관의 완전한 기능 세트는 다양한 문서 유형 및 98% 메모리 감소와 같은 최근 개선 사항을 포함합니다.

필수 조건을 충족하고 IronOCR를 통합하면 자동화된 영수증 처리의 이점을 확인할 수 있습니다. 라이브러리의 문서화, 예제, 및 문제 해결 가이드가 원활한 구현을 보장합니다.

자세한 정보는 라이선스 페이지를 방문하거나 C# Tesseract OCR 튜토리얼을 탐색하십시오.

자주 묻는 질문

C#에서 OCR을 사용하여 영수증 데이터 추출을 자동화하는 방법은 무엇인가요?

IronOCR 사용하면 C#에서 영수증 데이터 추출을 자동화할 수 있습니다. IronOCR을 사용하면 영수증 이미지에서 품목, 가격, 세금, 총액과 같은 주요 세부 정보를 높은 정확도로 추출할 수 있습니다.

C#으로 영수증 스캔 프로젝트를 설정하기 위한 필수 조건은 무엇입니까?

C#으로 영수증 스캔 프로젝트를 설정하려면 Visual Studio, 기본적인 C# 프로그래밍 지식, 그리고 프로젝트에 IronOCR 라이브러리가 설치되어 있어야 합니다.

Visual Studio에서 NuGet 패키지 관리자를 사용하여 OCR 라이브러리를 설치하는 방법은 무엇인가요?

Visual Studio를 열고 도구 > NuGet 패키지 관리자 > 솔루션용 NuGet 패키지 관리로 이동하여 IronOCR 검색한 다음 프로젝트에 설치하세요.

Visual Studio 명령줄을 사용하여 OCR 라이브러리를 설치할 수 있습니까?

예, Visual Studio의 패키지 관리자 콘솔을 열고 Install-Package IronOcr 명령을 실행하여 IronOCR 설치할 수 있습니다.

OCR을 사용하여 영수증 전체에서 텍스트를 추출하는 방법은 무엇인가요?

영수증 전체에서 텍스트를 추출하려면 IronOCR 사용하여 전체 영수증 이미지에 OCR을 수행한 다음 C# 코드를 사용하여 추출된 텍스트를 출력합니다.

영수증 스캔 API는 어떤 이점을 제공하나요?

IronOCR 과 같은 영수증 스캔 API는 데이터 추출을 자동화하고, 수동 오류를 최소화하며, 생산성을 향상시키고, 더 나은 비즈니스 의사 결정을 위해 지출 패턴에 대한 통찰력을 제공합니다.

OCR 라이브러리는 다국어 및 다국어 통화를 지원합니까?

네, IronOCR 다양한 언어, 통화 및 영수증 형식을 지원하므로 글로벌 환경에 적합합니다.

이미지에서 텍스트를 추출하는 데 있어 OCR 라이브러리의 정확도는 어느 정도입니까?

IronOCR 고급 OCR 알고리즘, 컴퓨터 비전 및 머신 러닝 모델을 사용하여 까다로운 환경에서도 높은 정확도를 보장합니다.

OCR을 사용하여 영수증에서 어떤 유형의 데이터를 추출할 수 있습니까?

IronOCR 품목, 가격, 세금, 총액 및 기타 영수증 세부 정보와 같은 데이터를 추출할 수 있습니다.

영수증 분석 자동화는 비즈니스 프로세스를 어떻게 개선할 수 있을까요?

IronOCR 사용하여 영수증 분석을 자동화하면 수동 입력을 줄이고 정확한 데이터 수집을 가능하게 하며 데이터 기반 의사 결정을 지원함으로써 비즈니스 프로세스가 개선됩니다.

칸나오팟 우돈판트
소프트웨어 엔지니어
카나팟은 소프트웨어 엔지니어가 되기 전 일본 홋카이도 대학교에서 환경 자원학 박사 학위를 취득했습니다. 학위 과정 중에는 생물생산공학과 소속 차량 로봇 연구실에서 활동하기도 했습니다. 2022년에는 C# 기술을 활용하여 Iron Software의 엔지니어링 팀에 합류했고, 현재 IronPDF 개발에 집중하고 있습니다. 카나팟은 IronPDF에 사용되는 대부분의 코드를 직접 작성하는 개발자로부터 배울 수 있다는 점에 만족하며, 동료들과의 소통을 통해 배우는 것 외에도 Iron Software에서 일하는 즐거움을 누리고 있습니다. 코딩이나 문서 작업을 하지 않을 때는 주로 PS5로 게임을 하거나 The Last of Us를 다시 시청하는 것을 즐깁니다.

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me