IronOCR로 C#에서 OCR 인식 신뢰도를 확인하는 방법
IronOCR의 OCR 인식 신뢰도는 인식한 텍스트가 얼마나 정확한지를 나타내는 0~100 사이의 값입니다. 점수가 높을수록 결과를 더 신뢰할 수 있으며, 모든 OcrResult 객체의 Confidence 속성에서 값을 확인할 수 있습니다.
OCR(광학 문자 인식)에서 인식 신뢰도는 OCR 시스템이 이미지나 문서에서 인식한 텍스트의 정확도에 대해 부여하는 확신도 또는 신뢰도 수준을 나타냅니다. 이는 OCR 시스템이 인식된 텍스트가 정확하다고 얼마나 확신하는지를 나타내는 척도입니다. 이 척도는 스캔된 문서나 사진, 또는 텍스트 품질이 일정하지 않은 이미지를 처리할 때 특히 중요해집니다.
높은 신뢰도 점수는 인식의 정확성에 대한 높은 확신도를 나타내는 반면, 낮은 신뢰도 점수는 인식의 신뢰도가 떨어질 수 있음을 시사합니다. 이 점수를 이해하면 애플리케이션에 적절한 유효성 검사 로직과 오류 처리를 구현하는 데 도움이 됩니다.
빠른 시작: 한 줄로 OCR 인식 신뢰도 확인이미지 파일 경로를 IronTesseract의 Read 메서드에 전달한 다음, 반환된 OcrResult의 Confidence 속성에서 텍스트 인식 신뢰도를 확인하세요. 이 값으로 OCR 결과의 정확도를 간단하게 평가할 수 있습니다.
-
1IronOCR를 NuGet Package Manager로 설치하십시오
-
2다음 코드 조각을 복사하여 실행하세요.
double confidence = new IronOcr.IronTesseract().Read("input.png").Confidence;Dim confidence As Double = New IronOcr.IronTesseract().Read("input.png").ConfidenceDim confidence As Double = New IronOcr.IronTesseract().Read("input.png").Confidence -
3실제 운영 환경에서 테스트할 수 있도록 배포하세요.
오늘 프로젝트에서 IronOCR 사용을 시작해보세요 무료 체험
기본 절차(5단계)
- 인식 신뢰도를 확인하는 C# 라이브러리를 다운로드합니다.
- 대상 이미지와 PDF 문서를 준비합니다.
- OCR 결과의
Confidence속성에 접근합니다. - 페이지, 단락, 줄, 단어, 문자별 신뢰도를 가져옵니다.
- 대체 단어 후보를 보려면
Choices속성을 확인합니다.
C#에서 OCR 인식 신뢰도를 확인하는 방법
입력 이미지에 OCR을 수행하면 텍스트 인식 신뢰도가 Confidence 속성에 저장됩니다. 'using' 문으로 사용이 끝난 객체를 자동으로 해제하세요. 이미지는 OcrImageInput 클래스로, PDF는 OcrPdfInput 클래스로 추가하세요. Read 메서드는 Confidence 속성을 확인할 수 있는 OcrResult 객체를 반환합니다.
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Get confidence level
double confidence = ocrResult.Confidence;using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Get confidence level
double confidence = ocrResult.Confidence;Imports IronOcr
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Add image
Private imageInput = New OcrImageInput("sample.tiff")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Get confidence level
Private confidence As Double = ocrResult.ConfidenceImports IronOcr
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Add image
Private imageInput = New OcrImageInput("sample.tiff")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Get confidence level
Private confidence As Double = ocrResult.Confidence반환되는 신뢰도 값은 0~100 사이이며 다음과 같이 해석할 수 있습니다.
- 90-100: 매우 높은 신뢰도 - 텍스트가 매우 신뢰할 만합니다.
- 80-89: 높은 신뢰도 - 텍스트가 일반적으로 정확하지만 약간의 불확실성이 있습니다.
- 70-79: 보통 신뢰도 - 텍스트에 일부 오류가 있을 수 있습니다.
- 70 미만: 낮은 신뢰도 - 텍스트를 검토하거나 다시 처리해야 합니다.
문서의 각 구성 요소에서 신뢰도를 확인하는 방법
문서 전체뿐 아니라 각 페이지, 단락, 줄, 단어, 문자의 신뢰도도 확인할 수 있습니다. 서로 가까이 있는 하나 이상의 단락으로 이루어진 블록의 신뢰도도 확인할 수 있습니다.
// Get page confidence level
double pageConfidence = ocrResult.Pages[0].Confidence;
// Get paragraph confidence level
double paragraphConfidence = ocrResult.Paragraphs[0].Confidence;
// Get line confidence level
double lineConfidence = ocrResult.Lines[0].Confidence;
// Get word confidence level
double wordConfidence = ocrResult.Words[0].Confidence;
// Get character confidence level
double characterConfidence = ocrResult.Characters[0].Confidence;
// Get block confidence level
double blockConfidence = ocrResult.Blocks[0].Confidence;// Get page confidence level
double pageConfidence = ocrResult.Pages[0].Confidence;
// Get paragraph confidence level
double paragraphConfidence = ocrResult.Paragraphs[0].Confidence;
// Get line confidence level
double lineConfidence = ocrResult.Lines[0].Confidence;
// Get word confidence level
double wordConfidence = ocrResult.Words[0].Confidence;
// Get character confidence level
double characterConfidence = ocrResult.Characters[0].Confidence;
// Get block confidence level
double blockConfidence = ocrResult.Blocks[0].Confidence;' Get page confidence level
Dim pageConfidence As Double = ocrResult.Pages(0).Confidence
' Get paragraph confidence level
Dim paragraphConfidence As Double = ocrResult.Paragraphs(0).Confidence
' Get line confidence level
Dim lineConfidence As Double = ocrResult.Lines(0).Confidence
' Get word confidence level
Dim wordConfidence As Double = ocrResult.Words(0).Confidence
' Get character confidence level
Dim characterConfidence As Double = ocrResult.Characters(0).Confidence
' Get block confidence level
Dim blockConfidence As Double = ocrResult.Blocks(0).Confidence' Get page confidence level
Dim pageConfidence As Double = ocrResult.Pages(0).Confidence
' Get paragraph confidence level
Dim paragraphConfidence As Double = ocrResult.Paragraphs(0).Confidence
' Get line confidence level
Dim lineConfidence As Double = ocrResult.Lines(0).Confidence
' Get word confidence level
Dim wordConfidence As Double = ocrResult.Words(0).Confidence
' Get character confidence level
Dim characterConfidence As Double = ocrResult.Characters(0).Confidence
' Get block confidence level
Dim blockConfidence As Double = ocrResult.Blocks(0).Confidence실제 예시: 신뢰도별 필터링
저품질 스캔본처럼 품질이 일정하지 않은 문서를 처리할 때는 신뢰도 점수로 결과를 필터링할 수 있습니다.
using IronOcr;
using System.Linq;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Configure for better accuracy
ocrTesseract.Configuration.ReadBarCodes = false;
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd;
// Add image
using var imageInput = new OcrImageInput("invoice.png");
// Apply filters to improve quality
imageInput.Deskew();
imageInput.DeNoise();
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Filter words with confidence above 85%
var highConfidenceWords = ocrResult.Words
.Where(word => word.Confidence >= 85)
.Select(word => word.Text)
.ToList();
// Process only high-confidence text
string reliableText = string.Join(" ", highConfidenceWords);
Console.WriteLine($"High confidence text: {reliableText}");
// Flag low-confidence words for manual review
var lowConfidenceWords = ocrResult.Words
.Where(word => word.Confidence < 85)
.Select(word => new { word.Text, word.Confidence })
.ToList();
foreach (var word in lowConfidenceWords)
{
Console.WriteLine($"Review needed: '{word.Text}' (Confidence: {word.Confidence:F2}%)");
}using IronOcr;
using System.Linq;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Configure for better accuracy
ocrTesseract.Configuration.ReadBarCodes = false;
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd;
// Add image
using var imageInput = new OcrImageInput("invoice.png");
// Apply filters to improve quality
imageInput.Deskew();
imageInput.DeNoise();
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Filter words with confidence above 85%
var highConfidenceWords = ocrResult.Words
.Where(word => word.Confidence >= 85)
.Select(word => word.Text)
.ToList();
// Process only high-confidence text
string reliableText = string.Join(" ", highConfidenceWords);
Console.WriteLine($"High confidence text: {reliableText}");
// Flag low-confidence words for manual review
var lowConfidenceWords = ocrResult.Words
.Where(word => word.Confidence < 85)
.Select(word => new { word.Text, word.Confidence })
.ToList();
foreach (var word in lowConfidenceWords)
{
Console.WriteLine($"Review needed: '{word.Text}' (Confidence: {word.Confidence:F2}%)");
}Imports IronOcr
Imports System.Linq
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Configure for better accuracy
ocrTesseract.Configuration.ReadBarCodes = False
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd
' Add image
Using imageInput As New OcrImageInput("invoice.png")
' Apply filters to improve quality
imageInput.Deskew()
imageInput.DeNoise()
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Filter words with confidence above 85%
Dim highConfidenceWords = ocrResult.Words _
.Where(Function(word) word.Confidence >= 85) _
.Select(Function(word) word.Text) _
.ToList()
' Process only high-confidence text
Dim reliableText As String = String.Join(" ", highConfidenceWords)
Console.WriteLine($"High confidence text: {reliableText}")
' Flag low-confidence words for manual review
Dim lowConfidenceWords = ocrResult.Words _
.Where(Function(word) word.Confidence < 85) _
.Select(Function(word) New With {Key .Text = word.Text, Key .Confidence = word.Confidence}) _
.ToList()
For Each word In lowConfidenceWords
Console.WriteLine($"Review needed: '{word.Text}' (Confidence: {word.Confidence:F2}%)")
Next
End UsingImports IronOcr
Imports System.Linq
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Configure for better accuracy
ocrTesseract.Configuration.ReadBarCodes = False
ocrTesseract.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd
' Add image
Using imageInput As New OcrImageInput("invoice.png")
' Apply filters to improve quality
imageInput.Deskew()
imageInput.DeNoise()
' Perform OCR
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Filter words with confidence above 85%
Dim highConfidenceWords = ocrResult.Words _
.Where(Function(word) word.Confidence >= 85) _
.Select(Function(word) word.Text) _
.ToList()
' Process only high-confidence text
Dim reliableText As String = String.Join(" ", highConfidenceWords)
Console.WriteLine($"High confidence text: {reliableText}")
' Flag low-confidence words for manual review
Dim lowConfidenceWords = ocrResult.Words _
.Where(Function(word) word.Confidence < 85) _
.Select(Function(word) New With {Key .Text = word.Text, Key .Confidence = word.Confidence}) _
.ToList()
For Each word In lowConfidenceWords
Console.WriteLine($"Review needed: '{word.Text}' (Confidence: {word.Confidence:F2}%)")
Next
End UsingOCR 문자 후보란 무엇입니까?
신뢰도 외에 Choices 속성도 사용할 수 있습니다. 이 속성에는 대체 단어 후보와 각 후보의 통계적 관련도가 담겨 있어 인식 결과에 들어갈 수 있는 다른 문자를 확인할 수 있습니다. 여러 언어나 특수 글꼴을 다룰 때 특히 유용합니다.
using IronOcr;
using static IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("Potter.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Get choices
Choice[] choices = ocrResult.Characters[0].Choices;using IronOcr;
using static IronOcr.OcrResult;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("Potter.tiff");
// Perform OCR
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Get choices
Choice[] choices = ocrResult.Characters[0].Choices;Imports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Add image
Private imageInput = New OcrImageInput("Potter.tiff")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Get choices
Private choices() As Choice = ocrResult.Characters(0).ChoicesImports IronOcr
Imports IronOcr.OcrResult
' Instantiate IronTesseract
Private ocrTesseract As New IronTesseract()
' Add image
Private imageInput = New OcrImageInput("Potter.tiff")
' Perform OCR
Private ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Get choices
Private choices() As Choice = ocrResult.Characters(0).Choices대체 문자 후보의 활용 사례
대체 문자 후보는 다음과 같은 경우에 유용합니다.
- 모호성 해결: 'O'와 '0' 또는 'l'과 '1'처럼 혼동하기 쉬운 문자 구분
- 글꼴 변형: 독특한 스타일이나 장식이 있는 글꼴의 여러 해석 검토
- 품질 문제: 품질이 떨어지는 텍스트의 여러 인식 후보 검토
- 언어 맥락: 언어 규칙에 따른 대체 해석 검토

문자 후보 활용하기
다음은 정확도를 높이기 위해 문자 후보를 활용하는 방법을 보여주는 포괄적인 예시입니다.
using IronOcr;
using System;
using System.Linq;
using static IronOcr.OcrResult;
// Configure IronTesseract for detailed results
IronTesseract ocrTesseract = new IronTesseract();
// Process image with potential ambiguities
using var imageInput = new OcrImageInput("ambiguous_text.png");
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Analyze character choices for each word
foreach (var word in ocrResult.Words)
{
Console.WriteLine($"\nWord: '{word.Text}' (Confidence: {word.Confidence:F2}%)");
// Check each character in the word
foreach (var character in word.Characters)
{
if (character.Choices != null && character.Choices.Length > 1)
{
Console.WriteLine($" Character '{character.Text}' has alternatives:");
// Display all choices sorted by confidence
foreach (var choice in character.Choices.OrderByDescending(c => c.Confidence))
{
Console.WriteLine($" - '{choice.Text}': {choice.Confidence:F2}%");
}
}
}
}using IronOcr;
using System;
using System.Linq;
using static IronOcr.OcrResult;
// Configure IronTesseract for detailed results
IronTesseract ocrTesseract = new IronTesseract();
// Process image with potential ambiguities
using var imageInput = new OcrImageInput("ambiguous_text.png");
OcrResult ocrResult = ocrTesseract.Read(imageInput);
// Analyze character choices for each word
foreach (var word in ocrResult.Words)
{
Console.WriteLine($"\nWord: '{word.Text}' (Confidence: {word.Confidence:F2}%)");
// Check each character in the word
foreach (var character in word.Characters)
{
if (character.Choices != null && character.Choices.Length > 1)
{
Console.WriteLine($" Character '{character.Text}' has alternatives:");
// Display all choices sorted by confidence
foreach (var choice in character.Choices.OrderByDescending(c => c.Confidence))
{
Console.WriteLine($" - '{choice.Text}': {choice.Confidence:F2}%");
}
}
}
}Imports IronOcr
Imports System
Imports System.Linq
Imports IronOcr.OcrResult
' Configure IronTesseract for detailed results
Dim ocrTesseract As New IronTesseract()
' Process image with potential ambiguities
Using imageInput As New OcrImageInput("ambiguous_text.png")
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Analyze character choices for each word
For Each word In ocrResult.Words
Console.WriteLine(vbCrLf & $"Word: '{word.Text}' (Confidence: {word.Confidence:F2}%)")
' Check each character in the word
For Each character In word.Characters
If character.Choices IsNot Nothing AndAlso character.Choices.Length > 1 Then
Console.WriteLine($" Character '{character.Text}' has alternatives:")
' Display all choices sorted by confidence
For Each choice In character.Choices.OrderByDescending(Function(c) c.Confidence)
Console.WriteLine($" - '{choice.Text}': {choice.Confidence:F2}%")
Next
End If
Next
Next
End UsingImports IronOcr
Imports System
Imports System.Linq
Imports IronOcr.OcrResult
' Configure IronTesseract for detailed results
Dim ocrTesseract As New IronTesseract()
' Process image with potential ambiguities
Using imageInput As New OcrImageInput("ambiguous_text.png")
Dim ocrResult As OcrResult = ocrTesseract.Read(imageInput)
' Analyze character choices for each word
For Each word In ocrResult.Words
Console.WriteLine(vbCrLf & $"Word: '{word.Text}' (Confidence: {word.Confidence:F2}%)")
' Check each character in the word
For Each character In word.Characters
If character.Choices IsNot Nothing AndAlso character.Choices.Length > 1 Then
Console.WriteLine($" Character '{character.Text}' has alternatives:")
' Display all choices sorted by confidence
For Each choice In character.Choices.OrderByDescending(Function(c) c.Confidence)
Console.WriteLine($" - '{choice.Text}': {choice.Confidence:F2}%")
Next
End If
Next
Next
End Using신뢰도를 활용한 고급 검증
여권, 번호판 또는 MICR 수표와 같은 전문 문서를 다룰 때, 신뢰도 점수는 유효성을 검사하는 데 필수적입니다:
using IronOcr;
using System;
using System.Linq;
public class DocumentValidator
{
private readonly IronTesseract ocr = new IronTesseract();
public bool ValidatePassportNumber(string imagePath, double minConfidence = 95.0)
{
using var input = new OcrImageInput(imagePath);
// Configure for passport reading
ocr.Configuration.ReadBarCodes = true;
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine;
// Apply preprocessing
input.Deskew();
input.Scale(200); // Upscale for better accuracy
var result = ocr.Read(input);
// Find passport number pattern
var passportLine = result.Lines
.Where(line => line.Text.Contains("P<") || IsPassportNumberFormat(line.Text))
.FirstOrDefault();
if (passportLine != null)
{
Console.WriteLine($"Passport line found: {passportLine.Text}");
Console.WriteLine($"Confidence: {passportLine.Confidence:F2}%");
// Only accept if confidence meets threshold
return passportLine.Confidence >= minConfidence;
}
return false;
}
private bool IsPassportNumberFormat(string text)
{
// Simple passport number validation
return System.Text.RegularExpressions.Regex.IsMatch(text, @"^[A-Z]\d{7,9}$");
}
}using IronOcr;
using System;
using System.Linq;
public class DocumentValidator
{
private readonly IronTesseract ocr = new IronTesseract();
public bool ValidatePassportNumber(string imagePath, double minConfidence = 95.0)
{
using var input = new OcrImageInput(imagePath);
// Configure for passport reading
ocr.Configuration.ReadBarCodes = true;
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine;
// Apply preprocessing
input.Deskew();
input.Scale(200); // Upscale for better accuracy
var result = ocr.Read(input);
// Find passport number pattern
var passportLine = result.Lines
.Where(line => line.Text.Contains("P<") || IsPassportNumberFormat(line.Text))
.FirstOrDefault();
if (passportLine != null)
{
Console.WriteLine($"Passport line found: {passportLine.Text}");
Console.WriteLine($"Confidence: {passportLine.Confidence:F2}%");
// Only accept if confidence meets threshold
return passportLine.Confidence >= minConfidence;
}
return false;
}
private bool IsPassportNumberFormat(string text)
{
// Simple passport number validation
return System.Text.RegularExpressions.Regex.IsMatch(text, @"^[A-Z]\d{7,9}$");
}
}Imports IronOcr
Imports System
Imports System.Linq
Public Class DocumentValidator
Private ReadOnly ocr As New IronTesseract()
Public Function ValidatePassportNumber(imagePath As String, Optional minConfidence As Double = 95.0) As Boolean
Using input = New OcrImageInput(imagePath)
' Configure for passport reading
ocr.Configuration.ReadBarCodes = True
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine
' Apply preprocessing
input.Deskew()
input.Scale(200) ' Upscale for better accuracy
Dim result = ocr.Read(input)
' Find passport number pattern
Dim passportLine = result.Lines _
.Where(Function(line) line.Text.Contains("P<") OrElse IsPassportNumberFormat(line.Text)) _
.FirstOrDefault()
If passportLine IsNot Nothing Then
Console.WriteLine($"Passport line found: {passportLine.Text}")
Console.WriteLine($"Confidence: {passportLine.Confidence:F2}%")
' Only accept if confidence meets threshold
Return passportLine.Confidence >= minConfidence
End If
End Using
Return False
End Function
Private Function IsPassportNumberFormat(text As String) As Boolean
' Simple passport number validation
Return System.Text.RegularExpressions.Regex.IsMatch(text, "^[A-Z]\d{7,9}$")
End Function
End ClassImports IronOcr
Imports System
Imports System.Linq
Public Class DocumentValidator
Private ReadOnly ocr As New IronTesseract()
Public Function ValidatePassportNumber(imagePath As String, Optional minConfidence As Double = 95.0) As Boolean
Using input = New OcrImageInput(imagePath)
' Configure for passport reading
ocr.Configuration.ReadBarCodes = True
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine
' Apply preprocessing
input.Deskew()
input.Scale(200) ' Upscale for better accuracy
Dim result = ocr.Read(input)
' Find passport number pattern
Dim passportLine = result.Lines _
.Where(Function(line) line.Text.Contains("P<") OrElse IsPassportNumberFormat(line.Text)) _
.FirstOrDefault()
If passportLine IsNot Nothing Then
Console.WriteLine($"Passport line found: {passportLine.Text}")
Console.WriteLine($"Confidence: {passportLine.Confidence:F2}%")
' Only accept if confidence meets threshold
Return passportLine.Confidence >= minConfidence
End If
End Using
Return False
End Function
Private Function IsPassportNumberFormat(text As String) As Boolean
' Simple passport number validation
Return System.Text.RegularExpressions.Regex.IsMatch(text, "^[A-Z]\d{7,9}$")
End Function
End Class인식 신뢰도를 높이는 방법
이미지 필터와 전처리 기법을 활용하면 인식 신뢰도 향상에 도움이 됩니다.
using IronOcr;
using System;
using System.Linq;
// Create an optimized OCR workflow
IronTesseract ocr = new IronTesseract();
using var input = new OcrImageInput("low_quality_scan.jpg");
// Apply multiple filters to improve confidence
input.Deskew(); // Correct rotation
input.DeNoise(); // Remove noise
input.Sharpen(); // Enhance edges
input.Dilate(); // Thicken text
input.Scale(150); // Upscale for clarity
// Configure for accuracy over speed
ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
ocr.Configuration.EngineMode = TesseractEngineMode.TesseractOnly;
var result = ocr.Read(input);
Console.WriteLine($"Document confidence: {result.Confidence:F2}%");
// Generate confidence report
var confidenceReport = result.Pages
.Select((page, index) => new
{
PageNumber = index + 1,
Confidence = page.Confidence,
WordCount = page.Words.Length,
LowConfidenceWords = page.Words.Count(w => w.Confidence < 80)
});
foreach (var page in confidenceReport)
{
Console.WriteLine($"Page {page.PageNumber}: {page.Confidence:F2}% confidence");
Console.WriteLine($" Total words: {page.WordCount}");
Console.WriteLine($" Low confidence words: {page.LowConfidenceWords}");
}using IronOcr;
using System;
using System.Linq;
// Create an optimized OCR workflow
IronTesseract ocr = new IronTesseract();
using var input = new OcrImageInput("low_quality_scan.jpg");
// Apply multiple filters to improve confidence
input.Deskew(); // Correct rotation
input.DeNoise(); // Remove noise
input.Sharpen(); // Enhance edges
input.Dilate(); // Thicken text
input.Scale(150); // Upscale for clarity
// Configure for accuracy over speed
ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
ocr.Configuration.EngineMode = TesseractEngineMode.TesseractOnly;
var result = ocr.Read(input);
Console.WriteLine($"Document confidence: {result.Confidence:F2}%");
// Generate confidence report
var confidenceReport = result.Pages
.Select((page, index) => new
{
PageNumber = index + 1,
Confidence = page.Confidence,
WordCount = page.Words.Length,
LowConfidenceWords = page.Words.Count(w => w.Confidence < 80)
});
foreach (var page in confidenceReport)
{
Console.WriteLine($"Page {page.PageNumber}: {page.Confidence:F2}% confidence");
Console.WriteLine($" Total words: {page.WordCount}");
Console.WriteLine($" Low confidence words: {page.LowConfidenceWords}");
}Imports IronOcr
Imports System
Imports System.Linq
' Create an optimized OCR workflow
Dim ocr As New IronTesseract()
Using input = New OcrImageInput("low_quality_scan.jpg")
' Apply multiple filters to improve confidence
input.Deskew() ' Correct rotation
input.DeNoise() ' Remove noise
input.Sharpen() ' Enhance edges
input.Dilate() ' Thicken text
input.Scale(150) ' Upscale for clarity
' Configure for accuracy over speed
ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
ocr.Configuration.EngineMode = TesseractEngineMode.TesseractOnly
Dim result = ocr.Read(input)
Console.WriteLine($"Document confidence: {result.Confidence:F2}%")
' Generate confidence report
Dim confidenceReport = result.Pages.Select(Function(page, index) New With {
.PageNumber = index + 1,
.Confidence = page.Confidence,
.WordCount = page.Words.Length,
.LowConfidenceWords = page.Words.Count(Function(w) w.Confidence < 80)
})
For Each page In confidenceReport
Console.WriteLine($"Page {page.PageNumber}: {page.Confidence:F2}% confidence")
Console.WriteLine($" Total words: {page.WordCount}")
Console.WriteLine($" Low confidence words: {page.LowConfidenceWords}")
Next
End UsingImports IronOcr
Imports System
Imports System.Linq
' Create an optimized OCR workflow
Dim ocr As New IronTesseract()
Using input = New OcrImageInput("low_quality_scan.jpg")
' Apply multiple filters to improve confidence
input.Deskew() ' Correct rotation
input.DeNoise() ' Remove noise
input.Sharpen() ' Enhance edges
input.Dilate() ' Thicken text
input.Scale(150) ' Upscale for clarity
' Configure for accuracy over speed
ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
ocr.Configuration.EngineMode = TesseractEngineMode.TesseractOnly
Dim result = ocr.Read(input)
Console.WriteLine($"Document confidence: {result.Confidence:F2}%")
' Generate confidence report
Dim confidenceReport = result.Pages.Select(Function(page, index) New With {
.PageNumber = index + 1,
.Confidence = page.Confidence,
.WordCount = page.Words.Length,
.LowConfidenceWords = page.Words.Count(Function(w) w.Confidence < 80)
})
For Each page In confidenceReport
Console.WriteLine($"Page {page.PageNumber}: {page.Confidence:F2}% confidence")
Console.WriteLine($" Total words: {page.WordCount}")
Console.WriteLine($" Low confidence words: {page.LowConfidenceWords}")
Next
End Using요약
OCR 신뢰도 점수를 이해하고 활용하는 것은 신뢰성 있는 문서 처리 응용 프로그램을 구축하는 데 필수적입니다. IronOCR의 신뢰도 속성과 문자 후보 기능을 활용하면 개발자는 OCR 워크플로에 지능형 유효성 검사, 오류 처리 및 품질 보증 메커니즘을 구현할 수 있습니다. 스크린샷, 표, 또는 특수 문서를 처리하든, 신뢰도 점수는 정확한 텍스트 추출을 보장하는 데 필요한 척도를 제공합니다.
자주 묻는 질문
IronOCR에서 OCR 읽기 신뢰도란 무엇입니까?
IronOCR의 OCR 읽기 신뢰도는 텍스트 인식 프로세스의 확실성을 나타냅니다. 0에서 100까지의 신뢰도 점수를 사용하며, 높은 점수는 인식된 텍스트의 더 큰 정확성을 의미합니다.
IronOCR에서 신뢰도 점수에 어떻게 접근할 수 있나요?
IronTesseract.Read 메서드에 의해 반환된 OcrResult 객체의 Confidence 속성을 이용하여 IronOCR에서 신뢰도 점수에 접근할 수 있습니다.
OCR에서 신뢰도 점수는 왜 중요한가요?
신뢰도 점수는 인식된 텍스트의 신뢰성을 평가하는 데 중요한 역할을 합니다. 이러한 점수를 이해함으로써 개발자들은 OCR 애플리케이션의 정확성을 높이기 위해 적절한 검증과 오류 처리 방법을 구현할 수 있습니다.
높은 OCR 신뢰도 점수는 무엇을 의미하나요?
높은 OCR 신뢰도 점수는 텍스트 인식 정확성에 대한 높은 확신을 의미하며, 추출된 텍스트가 올바르고 신뢰할 수 있음을 나타냅니다.
IronOCR가 텍스트의 다른 레벨에 대한 신뢰도 점수를 제공할 수 있나요?
네, IronOCR는 전체 문서, 페이지, 단락, 줄, 단어 및 문자 등 여러 레벨에 대한 신뢰도 점수를 제공하여 자세한 정확도 평가가 가능합니다.
IronOCR로 OCR 신뢰도 점수를 어떻게 개선할 수 있나요?
IronOCR로 OCR 신뢰도 점수를 개선하기 위해서는 기울기 보정, 잡음 제거, 이미지 확대 등의 전처리 기술을 적용할 수 있습니다. 또한 IronTesseract를 최적의 설정으로 구성하여 정확성을 높일 수 있습니다.
IronOCR에서 문자 선택이란 무엇입니까?
IronOCR에서의 문자 선택은 OCR 중 제공되는 대체 단어 선택 및 관련성 메트릭을 의미합니다. 이 기능은 모호성을 처리하고 텍스트의 잠재적 문자 변형을 이해하는 데 유용합니다.
문자 선택이 텍스트 인식에 어떻게 도움이 될 수 있나요?
문자 선택은 비슷한 모양의 문자와 단어에 대한 대체 해석을 제공하여 모호성을 해결하는 데 도움을 줍니다. 이는 특히 폰트 변형, 열화된 텍스트, 다중 언어를 다룰 때 유익합니다.
IronOCR 텍스트 정확성을 향상시키는 전처리 기술은 무엇입니까?
기울기 보정, 잡음 제거, 선명화, 스케일링과 같은 전처리 기술은 IronOCR를 사용한 OCR 프로세스를 실행하기 전 이미지 품질을 개선하여 텍스트 정확성을 크게 향상시킬 수 있습니다.
IronOCR는 낮은 신뢰도 인식 결과를 어떻게 처리하나요?
IronOCR는 검토를 위해 낮은 신뢰도 인식 결과를 필터링하고 표시할 수 있습니다. 특정 임계값 이하의 신뢰도 점수를 가진 단어를 식별하고 검증 또는 재처리 전략을 사용하여 불확실성을 해결할 수 있습니다.
커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.