読む信頼度を取得する方法
OCRの信頼度の読み取り(光学文字認識)画像や文書内で認識されたテキストの正確性に対するOCRシステムが割り当てる確信度または信頼性のレベルを指します。 それは、認識されたテキストが正しいとするOCRシステムの信頼度を示す指標です。
高い確信スコアは、認識が正確であるという高い確度を示しており、低い確信スコアは認識があまり信頼できない可能性があることを示唆しています。
IronOCRを始めましょう
今日から無料トライアルでIronOCRをあなたのプロジェクトで使い始めましょう。
読む信頼度を取得する方法
- C#ライブラリをダウンロードして、読み取り信頼度にアクセスする
- 対象となる画像とPDFドキュメントを準備します。
- アクセス 信頼 OCR結果のプロパティ
- ページ、段落、行、単語、文字の信頼度を取得する
- 以下をチェック 選択肢 代替語の選択肢に関するプロパティ
読み取り信頼度の例を取得
入力画像に対してOCRを実行した後、テキストの信頼レベルはConfidenceプロパティに保存されます。 using
ステートメントを利用して、自動的にオブジェクトを破棄します。 画像やPDFなどのドキュメントをそれぞれ OcrImageInput
クラスと OcrPdfInput
クラスを使用して追加します。 Read
メソッドは、Confidence プロパティへのアクセスを可能にする 'OcrResult' オブジェクトを返します。
:path=/static-assets/ocr/content-code-examples/how-to/tesseract-result-confidence-get-confidence.cs
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.Confidence
異なるレベルで読み取り信頼度を取得
ドキュメント全体の信頼度を取得するだけでなく、各ページ、段落、行、単語、および文字の信頼度にもアクセスできます。 さらに、一つ以上の段落が互いに近接して配置されているコレクションを表すブロックの信頼性を得ることができます。
:path=/static-assets/ocr/content-code-examples/how-to/tesseract-result-confidence-confidence-level.cs
// 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
文字の選択肢を取得
信頼度レベルとは別に、Choices(選択肢)と呼ばれる興味深いプロパティも存在します。 選択肢には、代替語の選択肢とその統計的関連性のリストが含まれています。 この情報により、ユーザーは他の可能な文字にアクセスできます。
:path=/static-assets/ocr/content-code-examples/how-to/tesseract-result-confidence-get-choices.cs
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).Choices