C#でのIronOCRを使用した進捗トラッキング方法
IronOCRは、OCR操作の進捗を追跡するイベントベースのシステムを提供し、開発者がリーディングの進捗を監視できるようにします。完了率、処理されたページ数、リアルタイムでの時間メトリクスを報告するOcrProgressイベントを通じてそれを行います。
この例では、IronOCRを使用してOCRの進捗を監視する方法を示します。組み込みのOcrProgressイベントを購読し、PDFを読みながら百分率、完了ページ数、合計ページ数を含む即時フィードバックを受け取ります。 ほんの数行で始められます。
-
1IronOCR を NuGet Package Manager でインストールします
-
2このコード スニペットをコピーして実行します。
using System; var ocr = new IronOcr.IronTesseract(); ocr.OcrProgress += (s, e) => Console.WriteLine(e.ProgressPercent + "% (" + e.PagesComplete + "/" + e.TotalPages + ")"); var input = new IronOcr.OcrInput(); input.LoadPdf("file.pdf"); var result = ocr.Read(input);Imports System Dim ocr = New IronOcr.IronTesseract() AddHandler ocr.OcrProgress, Sub(s, e) Console.WriteLine(e.ProgressPercent & "% (" & e.PagesComplete & "/" & e.TotalPages & ")") Dim input = New IronOcr.OcrInput() input.LoadPdf("file.pdf") Dim result = ocr.Read(input)Imports System Dim ocr = New IronOcr.IronTesseract() AddHandler ocr.OcrProgress, Sub(s, e) Console.WriteLine(e.ProgressPercent & "% (" & e.PagesComplete & "/" & e.TotalPages & ")") Dim input = New IronOcr.OcrInput() input.LoadPdf("file.pdf") Dim result = ocr.Read(input) -
3実際の環境でテストするためにデプロイする
今日からご自身のプロジェクトでIronOCRを使い始めるには、無料トライアルをお試しください。
最小限のワークフロー(5ステップ)
- リーディング進捗を追跡するためのC#ライブラリのダウンロード
- OcrProgressイベントを購読する
- イベントから渡されるインスタンスを利用して進捗情報を取得する
- 進捗をパーセンテージと総所要時間で取得する
- 開始時間と終了時間、および総ページ数を取得します
OCRアプリケーションに進捗追跡を実装するにはどうすればよいですか?
OCRで大規模な文書やバッチファイルを処理する場合、進行状況の追跡は不可欠です。 リーディングプロセスの進捗更新を受け取るために、OcrProgressイベントを購読できます。 これは特にPDF OCR操作や複数ページのTIFFファイルを扱う場合に便利です。
イベントは、OCRジョブの進捗に関する情報を含むインスタンスを渡します。開始時間、合計ページ数、百分率での進捗、所要時間、終了時間などです。この機能は非同期操作とともに動作し、より良いパフォーマンスのためにマルチスレッドと組み合わせることができます。
次の例では、実例としてこのドキュメントを使用します:「Experiences in Biodiversity Research: A Field Course」by Thea B. アイオワ州立大学のゲスラー氏。
using IronOcr;
using System;
var ocrTesseract = new IronTesseract();
// Subscribe to OcrProgress event
ocrTesseract.OcrProgress += (_, ocrProgressEventsArgs) =>
{
Console.WriteLine("Start time: " + ocrProgressEventsArgs.StartTimeUTC.ToString());
Console.WriteLine("Total pages number: " + ocrProgressEventsArgs.TotalPages);
Console.WriteLine("Progress(%) | Duration");
Console.WriteLine(" " + ocrProgressEventsArgs.ProgressPercent + "% | " + ocrProgressEventsArgs.Duration.TotalSeconds + "s");
Console.WriteLine("End time: " + ocrProgressEventsArgs.EndTimeUTC.ToString());
Console.WriteLine("----------------------------------------------");
};
using var input = new OcrInput();
input.LoadPdf("Experiences-in-Biodiversity-Research-A-Field-Course.pdf");
// Progress events will fire during the read operation
var result = ocrTesseract.Read(input);using IronOcr;
using System;
var ocrTesseract = new IronTesseract();
// Subscribe to OcrProgress event
ocrTesseract.OcrProgress += (_, ocrProgressEventsArgs) =>
{
Console.WriteLine("Start time: " + ocrProgressEventsArgs.StartTimeUTC.ToString());
Console.WriteLine("Total pages number: " + ocrProgressEventsArgs.TotalPages);
Console.WriteLine("Progress(%) | Duration");
Console.WriteLine(" " + ocrProgressEventsArgs.ProgressPercent + "% | " + ocrProgressEventsArgs.Duration.TotalSeconds + "s");
Console.WriteLine("End time: " + ocrProgressEventsArgs.EndTimeUTC.ToString());
Console.WriteLine("----------------------------------------------");
};
using var input = new OcrInput();
input.LoadPdf("Experiences-in-Biodiversity-Research-A-Field-Course.pdf");
// Progress events will fire during the read operation
var result = ocrTesseract.Read(input);Imports IronOcr
Imports System
Private ocrTesseract = New IronTesseract()
' Subscribe to OcrProgress event
Private ocrTesseract.OcrProgress += Sub(underscore, ocrProgressEventsArgs)
Console.WriteLine("Start time: " & ocrProgressEventsArgs.StartTimeUTC.ToString())
Console.WriteLine("Total pages number: " & ocrProgressEventsArgs.TotalPages)
Console.WriteLine("Progress(%) | Duration")
Console.WriteLine(" " & ocrProgressEventsArgs.ProgressPercent & "% | " & ocrProgressEventsArgs.Duration.TotalSeconds & "s")
Console.WriteLine("End time: " & ocrProgressEventsArgs.EndTimeUTC.ToString())
Console.WriteLine("----------------------------------------------")
End Sub
Private input = New OcrInput()
input.LoadPdf("Experiences-in-Biodiversity-Research-A-Field-Course.pdf")
' Progress events will fire during the read operation
Dim result = ocrTesseract.Read(input)Imports IronOcr
Imports System
Private ocrTesseract = New IronTesseract()
' Subscribe to OcrProgress event
Private ocrTesseract.OcrProgress += Sub(underscore, ocrProgressEventsArgs)
Console.WriteLine("Start time: " & ocrProgressEventsArgs.StartTimeUTC.ToString())
Console.WriteLine("Total pages number: " & ocrProgressEventsArgs.TotalPages)
Console.WriteLine("Progress(%) | Duration")
Console.WriteLine(" " & ocrProgressEventsArgs.ProgressPercent & "% | " & ocrProgressEventsArgs.Duration.TotalSeconds & "s")
Console.WriteLine("End time: " & ocrProgressEventsArgs.EndTimeUTC.ToString())
Console.WriteLine("----------------------------------------------")
End Sub
Private input = New OcrInput()
input.LoadPdf("Experiences-in-Biodiversity-Research-A-Field-Course.pdf")
' Progress events will fire during the read operation
Dim result = ocrTesseract.Read(input)イベントからどのような進捗情報にアクセスできますか?
OcrProgressイベントは、OCRパフォーマンスを監視および最適化するのに役立つ包括的な進捗データを提供します。 各プロパティは、操作の追跡において特定の目的を果たします:
ProgressPercent: 完了したページの百分率としてのOCRジョブの進捗状況。GUIアプリケーションのプログレスバーの更新に便利です。TotalPages: OCRエンジンによって処理されている総ページ数。完了予定時間の計算に不可欠です。PagesComplete: OCRリーディングが完全に完了したページ数。 このカウントは、ページが処理されるにつれて徐々に増えていきます。Duration: OCRジョブの総所要時間。全プロセスが完了するまでにかかった時間を示します。 このイベントがトリガーされるたびに更新されるTimeSpan形式で測定されます。StartTimeUTC: UTC形式で表されるOCRジョブが開始された日付と時間。EndTimeUTC: OCRジョブが100%完了した日付と時間、UTC形式です。 このプロパティは、OCRの処理中はNULLで、処理が終了すると入力されます。
進捗トラッキングの高度な実装
本番アプリケーションでは、より洗練された進捗管理を実装します。 この例には、エラー処理と詳細なロギングが含まれています:
using IronOcr;
using System;
using System.Diagnostics;
public class OcrProgressTracker
{
private readonly IronTesseract _tesseract;
private Stopwatch _stopwatch;
private int _lastReportedPercent = 0;
public OcrProgressTracker()
{
_tesseract = new IronTesseract();
// Configure for optimal performance
_tesseract.Language = OcrLanguage.EnglishBest;
_tesseract.Configuration.ReadBarCodes = false;
// Subscribe to progress event
_tesseract.OcrProgress += OnOcrProgress;
}
private void OnOcrProgress(object sender, OcrProgressEventsArgs e)
{
// Only report significant progress changes (every 10%)
if (e.ProgressPercent - _lastReportedPercent >= 10 || e.ProgressPercent == 100)
{
_lastReportedPercent = e.ProgressPercent;
Console.WriteLine($"Progress: {e.ProgressPercent}%");
Console.WriteLine($"Pages: {e.PagesComplete}/{e.TotalPages}");
Console.WriteLine($"Elapsed: {e.Duration.TotalSeconds:F1}s");
// Estimate remaining time
if (e.ProgressPercent > 0 && e.ProgressPercent < 100)
{
var estimatedTotal = e.Duration.TotalSeconds / (e.ProgressPercent / 100.0);
var remaining = estimatedTotal - e.Duration.TotalSeconds;
Console.WriteLine($"Estimated remaining: {remaining:F1}s");
}
Console.WriteLine("---");
}
}
public OcrResult ProcessDocument(string filePath)
{
_stopwatch = Stopwatch.StartNew();
using var input = new OcrInput();
input.LoadPdf(filePath);
// Apply image filters for better accuracy
input.Deskew();
input.DeNoise();
var result = _tesseract.Read(input);
_stopwatch.Stop();
Console.WriteLine($"Total processing time: {_stopwatch.Elapsed.TotalSeconds:F1}s");
return result;
}
}using IronOcr;
using System;
using System.Diagnostics;
public class OcrProgressTracker
{
private readonly IronTesseract _tesseract;
private Stopwatch _stopwatch;
private int _lastReportedPercent = 0;
public OcrProgressTracker()
{
_tesseract = new IronTesseract();
// Configure for optimal performance
_tesseract.Language = OcrLanguage.EnglishBest;
_tesseract.Configuration.ReadBarCodes = false;
// Subscribe to progress event
_tesseract.OcrProgress += OnOcrProgress;
}
private void OnOcrProgress(object sender, OcrProgressEventsArgs e)
{
// Only report significant progress changes (every 10%)
if (e.ProgressPercent - _lastReportedPercent >= 10 || e.ProgressPercent == 100)
{
_lastReportedPercent = e.ProgressPercent;
Console.WriteLine($"Progress: {e.ProgressPercent}%");
Console.WriteLine($"Pages: {e.PagesComplete}/{e.TotalPages}");
Console.WriteLine($"Elapsed: {e.Duration.TotalSeconds:F1}s");
// Estimate remaining time
if (e.ProgressPercent > 0 && e.ProgressPercent < 100)
{
var estimatedTotal = e.Duration.TotalSeconds / (e.ProgressPercent / 100.0);
var remaining = estimatedTotal - e.Duration.TotalSeconds;
Console.WriteLine($"Estimated remaining: {remaining:F1}s");
}
Console.WriteLine("---");
}
}
public OcrResult ProcessDocument(string filePath)
{
_stopwatch = Stopwatch.StartNew();
using var input = new OcrInput();
input.LoadPdf(filePath);
// Apply image filters for better accuracy
input.Deskew();
input.DeNoise();
var result = _tesseract.Read(input);
_stopwatch.Stop();
Console.WriteLine($"Total processing time: {_stopwatch.Elapsed.TotalSeconds:F1}s");
return result;
}
}Imports IronOcr
Imports System
Imports System.Diagnostics
Public Class OcrProgressTracker
Private ReadOnly _tesseract As IronTesseract
Private _stopwatch As Stopwatch
Private _lastReportedPercent As Integer = 0
Public Sub New()
_tesseract = New IronTesseract()
' Configure for optimal performance
_tesseract.Language = OcrLanguage.EnglishBest
_tesseract.Configuration.ReadBarCodes = False
' Subscribe to progress event
AddHandler _tesseract.OcrProgress, AddressOf OnOcrProgress
End Sub
Private Sub OnOcrProgress(sender As Object, e As OcrProgressEventsArgs)
' Only report significant progress changes (every 10%)
If e.ProgressPercent - _lastReportedPercent >= 10 OrElse e.ProgressPercent = 100 Then
_lastReportedPercent = e.ProgressPercent
Console.WriteLine($"Progress: {e.ProgressPercent}%")
Console.WriteLine($"Pages: {e.PagesComplete}/{e.TotalPages}")
Console.WriteLine($"Elapsed: {e.Duration.TotalSeconds:F1}s")
' Estimate remaining time
If e.ProgressPercent > 0 AndAlso e.ProgressPercent < 100 Then
Dim estimatedTotal = e.Duration.TotalSeconds / (e.ProgressPercent / 100.0)
Dim remaining = estimatedTotal - e.Duration.TotalSeconds
Console.WriteLine($"Estimated remaining: {remaining:F1}s")
End If
Console.WriteLine("---")
End If
End Sub
Public Function ProcessDocument(filePath As String) As OcrResult
_stopwatch = Stopwatch.StartNew()
Using input As New OcrInput()
input.LoadPdf(filePath)
' Apply image filters for better accuracy
input.Deskew()
input.DeNoise()
Dim result = _tesseract.Read(input)
_stopwatch.Stop()
Console.WriteLine($"Total processing time: {_stopwatch.Elapsed.TotalSeconds:F1}s")
Return result
End Using
End Function
End ClassImports IronOcr
Imports System
Imports System.Diagnostics
Public Class OcrProgressTracker
Private ReadOnly _tesseract As IronTesseract
Private _stopwatch As Stopwatch
Private _lastReportedPercent As Integer = 0
Public Sub New()
_tesseract = New IronTesseract()
' Configure for optimal performance
_tesseract.Language = OcrLanguage.EnglishBest
_tesseract.Configuration.ReadBarCodes = False
' Subscribe to progress event
AddHandler _tesseract.OcrProgress, AddressOf OnOcrProgress
End Sub
Private Sub OnOcrProgress(sender As Object, e As OcrProgressEventsArgs)
' Only report significant progress changes (every 10%)
If e.ProgressPercent - _lastReportedPercent >= 10 OrElse e.ProgressPercent = 100 Then
_lastReportedPercent = e.ProgressPercent
Console.WriteLine($"Progress: {e.ProgressPercent}%")
Console.WriteLine($"Pages: {e.PagesComplete}/{e.TotalPages}")
Console.WriteLine($"Elapsed: {e.Duration.TotalSeconds:F1}s")
' Estimate remaining time
If e.ProgressPercent > 0 AndAlso e.ProgressPercent < 100 Then
Dim estimatedTotal = e.Duration.TotalSeconds / (e.ProgressPercent / 100.0)
Dim remaining = estimatedTotal - e.Duration.TotalSeconds
Console.WriteLine($"Estimated remaining: {remaining:F1}s")
End If
Console.WriteLine("---")
End If
End Sub
Public Function ProcessDocument(filePath As String) As OcrResult
_stopwatch = Stopwatch.StartNew()
Using input As New OcrInput()
input.LoadPdf(filePath)
' Apply image filters for better accuracy
input.Deskew()
input.DeNoise()
Dim result = _tesseract.Read(input)
_stopwatch.Stop()
Console.WriteLine($"Total processing time: {_stopwatch.Elapsed.TotalSeconds:F1}s")
Return result
End Using
End Function
End ClassUIアプリケーションとの進捗トラッキングの統合
Windows FormsやWPFでデスクトップアプリケーションを構築する場合、進捗管理はユーザーエクスペリエンスにとって非常に重要です。 progressイベントは、UI要素を安全に更新することができます:
using System;
using System.Windows.Forms;
using IronOcr;
public partial class OcrForm : Form
{
private IronTesseract _tesseract;
private ProgressBar progressBar;
private Label statusLabel;
public OcrForm()
{
InitializeComponent();
_tesseract = new IronTesseract();
_tesseract.OcrProgress += UpdateProgress;
}
private void UpdateProgress(object sender, OcrProgressEventsArgs e)
{
// Ensure UI updates happen on the main thread
if (InvokeRequired)
{
BeginInvoke(new Action(() => UpdateProgress(sender, e)));
return;
}
progressBar.Value = e.ProgressPercent;
statusLabel.Text = $"Processing page {e.PagesComplete} of {e.TotalPages}";
// Show completion message
if (e.ProgressPercent == 100)
{
MessageBox.Show($"OCR completed in {e.Duration.TotalSeconds:F1} seconds");
}
}
}using System;
using System.Windows.Forms;
using IronOcr;
public partial class OcrForm : Form
{
private IronTesseract _tesseract;
private ProgressBar progressBar;
private Label statusLabel;
public OcrForm()
{
InitializeComponent();
_tesseract = new IronTesseract();
_tesseract.OcrProgress += UpdateProgress;
}
private void UpdateProgress(object sender, OcrProgressEventsArgs e)
{
// Ensure UI updates happen on the main thread
if (InvokeRequired)
{
BeginInvoke(new Action(() => UpdateProgress(sender, e)));
return;
}
progressBar.Value = e.ProgressPercent;
statusLabel.Text = $"Processing page {e.PagesComplete} of {e.TotalPages}";
// Show completion message
if (e.ProgressPercent == 100)
{
MessageBox.Show($"OCR completed in {e.Duration.TotalSeconds:F1} seconds");
}
}
}Imports System
Imports System.Windows.Forms
Imports IronOcr
Public Partial Class OcrForm
Inherits Form
Private _tesseract As IronTesseract
Private progressBar As ProgressBar
Private statusLabel As Label
Public Sub New()
InitializeComponent()
_tesseract = New IronTesseract()
AddHandler _tesseract.OcrProgress, AddressOf UpdateProgress
End Sub
Private Sub UpdateProgress(sender As Object, e As OcrProgressEventsArgs)
' Ensure UI updates happen on the main thread
If InvokeRequired Then
BeginInvoke(New Action(Sub() UpdateProgress(sender, e)))
Return
End If
progressBar.Value = e.ProgressPercent
statusLabel.Text = $"Processing page {e.PagesComplete} of {e.TotalPages}"
' Show completion message
If e.ProgressPercent = 100 Then
MessageBox.Show($"OCR completed in {e.Duration.TotalSeconds:F1} seconds")
End If
End Sub
End ClassImports System
Imports System.Windows.Forms
Imports IronOcr
Public Partial Class OcrForm
Inherits Form
Private _tesseract As IronTesseract
Private progressBar As ProgressBar
Private statusLabel As Label
Public Sub New()
InitializeComponent()
_tesseract = New IronTesseract()
AddHandler _tesseract.OcrProgress, AddressOf UpdateProgress
End Sub
Private Sub UpdateProgress(sender As Object, e As OcrProgressEventsArgs)
' Ensure UI updates happen on the main thread
If InvokeRequired Then
BeginInvoke(New Action(Sub() UpdateProgress(sender, e)))
Return
End If
progressBar.Value = e.ProgressPercent
statusLabel.Text = $"Processing page {e.PagesComplete} of {e.TotalPages}"
' Show completion message
If e.ProgressPercent = 100 Then
MessageBox.Show($"OCR completed in {e.Duration.TotalSeconds:F1} seconds")
End If
End Sub
End Class大規模な文書とタイムアウトの取り扱い
広範なドキュメントを処理する場合、進行状況の追跡がさらに重要になります。 タイムアウト設定および中止トークンと組み合わせて、より良い制御を実現します:
using IronOcr;
using System;
using System.Threading;
public async Task ProcessLargeDocumentWithTimeout()
{
var cts = new CancellationTokenSource();
var tesseract = new IronTesseract();
// Set a timeout of 5 minutes
cts.CancelAfter(TimeSpan.FromMinutes(5));
tesseract.OcrProgress += (s, e) =>
{
Console.WriteLine($"Progress: {e.ProgressPercent}% - Page {e.PagesComplete}/{e.TotalPages}");
// Check if we should cancel based on progress
if (e.Duration.TotalMinutes > 4 && e.ProgressPercent < 50)
{
Console.WriteLine("Processing too slow, cancelling...");
cts.Cancel();
}
};
try
{
using var input = new OcrInput();
input.LoadPdf("large-document.pdf");
var result = await Task.Run(() =>
tesseract.Read(input), cts.Token);
Console.WriteLine("OCR completed successfully");
}
catch (OperationCanceledException)
{
Console.WriteLine("OCR operation was cancelled");
}
}using IronOcr;
using System;
using System.Threading;
public async Task ProcessLargeDocumentWithTimeout()
{
var cts = new CancellationTokenSource();
var tesseract = new IronTesseract();
// Set a timeout of 5 minutes
cts.CancelAfter(TimeSpan.FromMinutes(5));
tesseract.OcrProgress += (s, e) =>
{
Console.WriteLine($"Progress: {e.ProgressPercent}% - Page {e.PagesComplete}/{e.TotalPages}");
// Check if we should cancel based on progress
if (e.Duration.TotalMinutes > 4 && e.ProgressPercent < 50)
{
Console.WriteLine("Processing too slow, cancelling...");
cts.Cancel();
}
};
try
{
using var input = new OcrInput();
input.LoadPdf("large-document.pdf");
var result = await Task.Run(() =>
tesseract.Read(input), cts.Token);
Console.WriteLine("OCR completed successfully");
}
catch (OperationCanceledException)
{
Console.WriteLine("OCR operation was cancelled");
}
}Imports IronOcr
Imports System
Imports System.Threading
Public Async Function ProcessLargeDocumentWithTimeout() As Task
Dim cts = New CancellationTokenSource()
Dim tesseract = New IronTesseract()
' Set a timeout of 5 minutes
cts.CancelAfter(TimeSpan.FromMinutes(5))
AddHandler tesseract.OcrProgress, Sub(s, e)
Console.WriteLine($"Progress: {e.ProgressPercent}% - Page {e.PagesComplete}/{e.TotalPages}")
' Check if we should cancel based on progress
If e.Duration.TotalMinutes > 4 AndAlso e.ProgressPercent < 50 Then
Console.WriteLine("Processing too slow, cancelling...")
cts.Cancel()
End If
End Sub
Try
Using input = New OcrInput()
input.LoadPdf("large-document.pdf")
Dim result = Await Task.Run(Function() tesseract.Read(input), cts.Token)
Console.WriteLine("OCR completed successfully")
End Using
Catch ex As OperationCanceledException
Console.WriteLine("OCR operation was cancelled")
End Try
End FunctionImports IronOcr
Imports System
Imports System.Threading
Public Async Function ProcessLargeDocumentWithTimeout() As Task
Dim cts = New CancellationTokenSource()
Dim tesseract = New IronTesseract()
' Set a timeout of 5 minutes
cts.CancelAfter(TimeSpan.FromMinutes(5))
AddHandler tesseract.OcrProgress, Sub(s, e)
Console.WriteLine($"Progress: {e.ProgressPercent}% - Page {e.PagesComplete}/{e.TotalPages}")
' Check if we should cancel based on progress
If e.Duration.TotalMinutes > 4 AndAlso e.ProgressPercent < 50 Then
Console.WriteLine("Processing too slow, cancelling...")
cts.Cancel()
End If
End Sub
Try
Using input = New OcrInput()
input.LoadPdf("large-document.pdf")
Dim result = Await Task.Run(Function() tesseract.Read(input), cts.Token)
Console.WriteLine("OCR completed successfully")
End Using
Catch ex As OperationCanceledException
Console.WriteLine("OCR operation was cancelled")
End Try
End Function進捗トラッキングのベストプラクティス
- 更新頻度:加工中に
OcrProgressイベントが頻繁に発生します。 UIやログを圧迫しないよう、更新のフィルタリングを検討してください。 - パフォーマンスへの影響:進捗トラッキングはパフォーマンスのオーバーヘッドが最小ですが、過度のログ記録やUIの更新はOCRプロセスを遅延させる可能性があります。
- メモリ管理:大規模なTIFFファイルやPDFの場合、最適なパフォーマンスを確保するために進捗と一緒にメモリ使用量を監視します。
- エラーハンドリング:進捗イベントハンドラには常にエラーハンドリングを含めて、例外がOCRプロセスを妨害しないようにします。
- スレッドセーフティ: 進捗イベントからUI要素を更新する際は、
InvokeまたはBeginInvokeメソッドを使用して、適切なスレッド同期を確保してください。
結論
IronOCRのプログレス・トラッキングはOCR処理に必要不可欠な可視性を提供し、開発者は処理状況をユーザーに知らせる応答性の高いアプリケーションを作成することができます。 OcrProgressイベントを効果的に活用することで、シングルページの文書から大規模なPDFファイルに渡るすべてを自信を持って処理するプロフェッショナルなアプリケーションを構築できます。
より高度なOCRテクニックについては、OCR実装をさらに強化するために画像フィルタと結果オブジェクトに関する当社のガイドを探索してください。
よくある質問
IronOCRのOcrProgressイベントとは何ですか?
IronOCRのOcrProgressイベントは、完了率、処理されたページ数、タイムメトリクスをリアルタイムで提供するイベントベースの進捗追跡システムです。
IronOCRを使用してリアルタイムでOCRの進捗を監視するにはどうすればよいですか?
OcrProgressイベントを購読することで、完了率、処理ページ数、読み込みページ数についての即時フィードバックをリアルタイムで監視することができます。
OcrProgressイベントはどのような種類の進捗データを提供しますか?
OcrProgressイベントは、進捗率、処理中のページ合計数、完了ページ数、ジョブの継続時間、開始および終了時間をUTCで提供し、OCR操作を追跡するのに役立ちます。
IronOCRの進捗追跡は非同期操作で使用できますか?
はい、IronOCRの進捗追跡は非同期操作と統合でき、大量のドキュメント処理を効率的に管理するのに適しています。
IronOCRを使用してWindows Formsアプリケーションで進捗追跡を統合するにはどうすればよいですか?
Windows Formsアプリケーションでは、OcrProgressイベントを使用して、進捗バーやラベルなどのUI要素を安全に更新できます。スレッドの安全性を確保するためにInvokeまたはBeginInvokeメソッドを活用します。
OcrProgressの更新に推奨される頻度がありますか?
OcrProgressイベントは頻繁に発火しますが、更新をフィルタリングしてUIやログが過負荷にならないようにすることをお勧めします。これによりパフォーマンスへの影響を避けることができます。
IronOCRの進捗追跡は大容量ドキュメントの処理をどのように改善しますか?
大容量ドキュメントを扱う際、IronOCRの進捗追跡によりタイムアウト設定や中止トークンでの制御が可能になり、遅い処理の効率的な管理が提供されます。
IronOCRでの進捗追跡はパフォーマンスに影響しますか?
IronOCRでの進捗追跡はパフォーマンスのオーバーヘッドが最小限ですが、進捗イベントに基づく過剰なログやUI更新が全体のOCRプロセスを遅くする可能性があります。
IronOCRで進捗追跡を使用する際のベストプラクティスは何ですか?
ベストプラクティスには更新頻度の管理、UI要素を更新する際のスレッドの安全性の確保、および円滑なOCR操作を維持するためのエラーハンドリングの組み込みが含まれます。
IronOCRはマルチスレッド環境での進捗追跡に使用できますか?
はい、IronOCRの進捗追跡はマルチスレッドと組み合わせることでOCRのパフォーマンスを向上させ、複数のドキュメントや大きなファイルをより効率的に処理します。
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。