IronBarcode ハウツー 読み取り速度オプション IronBarcodeでC#の読み取り速度を調整する方法 カーティス・チャウ 更新日:2026年1月10日 IronBarcode をダウンロード NuGet ダウンロード DLL ダウンロード 無料トライアル LLM向けのコピー LLM向けのコピー LLM 用の Markdown としてページをコピーする ChatGPTで開く このページについてChatGPTに質問する ジェミニで開く このページについてGeminiに問い合わせる Grokで開く このページについてGrokに質問する 困惑の中で開く このページについてPerplexityに問い合わせる 共有する Facebook で共有 Xでシェア(Twitter) LinkedIn で共有 URLをコピー 記事をメールで送る This article was translated from English: Does it need improvement? Translated View the article in English IronBarcodeは4つの読み取り速度オプション(Faster, Balanced, Detailed, ExtremeDetail)を提供しており、C#でバーコードを読み取る際の処理速度と精度のトレードオフをコントロールすることができます。 はじめに 大量の BarCode セットを読み取る際には正確さが不可欠ですが、リソースの割り当てと処理効率も同様に重要な考慮事項です。 入力画像の品質によって、バーコードリーダーがどのように処理すべきかが決まります。鮮明な画像の場合は前処理を省略し、劣化したバーコードの場合はよりリソース集約的なオプションを使用して精度を向上させます。 IronBarcodeは処理速度と精度レベルを柔軟に選択できるため、バーコード読み取りプロセスのあらゆる側面を制御することができます。 入力イメージと利用可能なリソースに基づいて決定することができます。 より高度なバーコード読み取りシナリオについては、包括的なバーコード読み取りチュートリアルを参照してください。 この記事では、さまざまなシナリオに最適な読み取り速度を選択するためのガイドラインを提供します。 QRコードのサンプルを使用し、読み取り速度の変更が結果にどのように影響するかを実演します。 QRコードに特化して作業している場合は、C# QR Code Generator tutorial でテストサンプルを作成してください。 クイックスタート: バランスの取れた速度でバーコードを読み取る IronBarcodeのBarcodeReaderOptionsを使用して、スキャンのSpeedレベルを即座に設定します。 この例では、Balanced設定を使用してバーコードをすばやく読み取り、高速で信頼性の高い結果を得る方法を示します。 今すぐ NuGet で PDF を作成してみましょう: NuGet パッケージ マネージャーを使用して IronBarcode をインストールします PM > Install-Package BarCode このコード スニペットをコピーして実行します。 var results = IronBarCode.BarcodeReader.Read("path/to/image.png", new IronBarCode.BarcodeReaderOptions { Speed = IronBarCode.ReadingSpeed.Balanced }); 実際の環境でテストするためにデプロイする 今すぐ無料トライアルでプロジェクトに IronBarcode を使い始めましょう 30日間無料トライアル ### 最小限のワークフロー(5ステップ) 読み取り速度を調整するためのC#ライブラリをダウンロードする BarcodeReaderOptionsクラスを利用して読み取り速度を設定します Readメソッドを使用して、さまざまな画像形式からバーコード値を抽出します。 バーコードの値を印刷 異なる読み取り速度間のパフォーマンスのトレードオフを評価する 異なる読み取り速度のオプションは何ですか? IronBarcodeには4つのReadingSpeedオプションがあります:Faster、Balanced、Detailed、ExtremeDetailです。 ライブラリの機能を実証するために、劣化したBarCode画像と鮮明な画像を含むサンプルセットを使用して、各オプションを検証します。 サポートされているフォーマットの完全なリストについては、サポートされているバーコードフォーマットのページをご覧ください。 .NETベンチマークライブラリを使用して処理時間とメモリ使用量を測定し、各オプションの比較と各読み取り速度の理想的なシナリオを示します。 ベンチマークコードと、劣化したBarCodeの読み取り成功数をカウントする簡単な方法を実演します。 リーダーオプションの設定の詳細については、BarCodeリーダー設定例をご覧ください。 高速化オプションはいつ使用すべきですか? Fasterオプションは、最小限のリソースで最速のバーコード読み取りを提供しますが、精度は低下します。 このプロセスは画像の前処理を省略するため、入力画像がすでにシャープで鮮明な場合に最適です。 この例では、SpeedプロパティをReadingSpeed.Fasterに設定し、バーコードのディレクトリをインポートし、見つかったバーコードを画像ごとに値、タイプ、カウントとともに表示します。 さまざまな画像形式から BarCode を読み取る方法については、画像からバーコードを読み取るのガイドを参照してください。 :path=/static-assets/barcode/content-code-examples/how-to/reading-speed-option-faster.cs using IronBarCode; using System; using System.Diagnostics; using System.IO; using System.Linq; var optionsFaster = new BarcodeReaderOptions { Speed = ReadingSpeed.Faster }; // Directory containing PDF files string folderPath = @"YOUR_FILE_PATH"; // Get all PDF files in the directory var pdfFiles = Directory.GetFiles(folderPath, "*.jpg"); int countFaster = 0; var stopwatch = Stopwatch.StartNew(); foreach (var file in pdfFiles) { // Read the barcode var results = BarcodeReader.Read(file, optionsFaster); if (results.Any()) { Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}"); foreach (var result in results) { Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}"); countFaster++; } } else { Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}"); } } stopwatch.Stop(); // Print number of images the barcode reader could decode Console.WriteLine($"Faster could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms"); Imports IronBarCode Imports System Imports System.Diagnostics Imports System.IO Imports System.Linq Dim optionsFaster As New BarcodeReaderOptions With { .Speed = ReadingSpeed.Faster } ' Directory containing PDF files Dim folderPath As String = "YOUR_FILE_PATH" ' Get all PDF files in the directory Dim pdfFiles = Directory.GetFiles(folderPath, "*.jpg") Dim countFaster As Integer = 0 Dim stopwatch As Stopwatch = Stopwatch.StartNew() For Each file In pdfFiles ' Read the barcode Dim results = BarcodeReader.Read(file, optionsFaster) If results.Any() Then Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}") For Each result In results Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}") countFaster += 1 Next Else Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}") End If Next stopwatch.Stop() ' Print number of images the barcode reader could decode Console.WriteLine($"Faster could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms") $vbLabelText $csharpLabel Fasterオプションでは、430件中146件のバーコードを25秒で検出し、33.95%の精度を達成しました。 この方法は高速ですが、画像がきれいな状態でなければ適していません。 1つの画像で複数の BarCode を扱う場合は、reading multiple barcodes のガイドを参考にして、最適な設定を行ってください。 なぜBalancedが推奨される速度オプションなのか Balancedオプションは、正確さと読み取り性能のバランスをとります。 IronBarcodeは、バーコード領域を明確にするために軽い画像処理を適用し、検出と読み取りを容易にします。 最近の画像では、軽い処理で正確な結果が得られることが多いため、この設定を推奨します。 同じ画像を使って、Balancedが出力結果にどのように影響するかを示してみましょう。 非同期処理については、async and multithreading with IronBarcodeのガイドをご覧ください。 :path=/static-assets/barcode/content-code-examples/how-to/reading-speed-option-balanced.cs using IronBarCode; using System; using System.Diagnostics; using System.IO; using System.Linq; var optionsFaster = new BarcodeReaderOptions { Speed = ReadingSpeed.Balanced }; // Directory containing PDF files string folderPath = @"YOUR_FILE_PATH"; // Get all PDF files in the directory var pdfFiles = Directory.GetFiles(folderPath, "*.jpg"); int countFaster = 0; var stopwatch = Stopwatch.StartNew(); foreach (var file in pdfFiles) { // Read the barcode var results = BarcodeReader.Read(file, optionsFaster); if (results.Any()) { Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}"); foreach (var result in results) { Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}"); countFaster++; } } else { Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}"); } } stopwatch.Stop(); // Print number of images the barcode reader could decode Console.WriteLine($"Balanced could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms"); Imports IronBarCode Imports System Imports System.Diagnostics Imports System.IO Imports System.Linq Dim optionsFaster As New BarcodeReaderOptions With { .Speed = ReadingSpeed.Balanced } ' Directory containing PDF files Dim folderPath As String = "YOUR_FILE_PATH" ' Get all PDF files in the directory Dim pdfFiles = Directory.GetFiles(folderPath, "*.jpg") Dim countFaster As Integer = 0 Dim stopwatch As Stopwatch = Stopwatch.StartNew() For Each file In pdfFiles ' Read the barcode Dim results = BarcodeReader.Read(file, optionsFaster) If results.Any() Then Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}") For Each result In results Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}") countFaster += 1 Next Else Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}") End If Next stopwatch.Stop() ' Print number of images the barcode reader could decode Console.WriteLine($"Balanced could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms") $vbLabelText $csharpLabel Balancedオプションは、43秒で430件中237件のバーコード結果を検出しました。 Fasterと比較して、わずかな時間の増加で、55.11%の精度を提供します。 このオプションは、メモリとスピードの効率的なバランスを維持するため、ほとんどの状況に最適で、出発点として推奨されます。 このバランスの取れたアプローチは、適切な画像前処理技術によって特に効果的に機能します。 詳細なスピードオプションはいつ必要ですか? 画像が大きくぼやけたり歪んだりして、Balancedでは明確な結果が得られない場合は、Detailedオプションを使用してください。 バーコード領域を明確にし、デジタルノイズを減らして検出を向上させるために、中程度の前処理を適用します。 ひどく劣化した画像については、画像補正ガイドを参照してください。このガイドでは、さまざまな前処理テクニックについて説明しています。 Detailed設定を適用し、出力への効果を観察してみましょう。 :path=/static-assets/barcode/content-code-examples/how-to/reading-speed-option-detailed.cs using IronBarCode; using System; using System.Diagnostics; using System.IO; using System.Linq; var optionsFaster = new BarcodeReaderOptions { Speed = ReadingSpeed.Detailed }; // Directory containing PDF files string folderPath = @"YOUR_FILE_PATH"; // Get all PDF files in the directory var pdfFiles = Directory.GetFiles(folderPath, "*.jpg"); int countFaster = 0; var stopwatch = Stopwatch.StartNew(); foreach (var file in pdfFiles) { // Read the barcode var results = BarcodeReader.Read(file, optionsFaster); if (results.Any()) { Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}"); foreach (var result in results) { Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}"); countFaster++; } } else { Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}"); } } stopwatch.Stop(); // Print number of images the barcode reader could decode Console.WriteLine($"Detailed could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms"); Imports IronBarCode Imports System Imports System.Diagnostics Imports System.IO Imports System.Linq Dim optionsFaster As New BarcodeReaderOptions With { .Speed = ReadingSpeed.Detailed } ' Directory containing PDF files Dim folderPath As String = "YOUR_FILE_PATH" ' Get all PDF files in the directory Dim pdfFiles = Directory.GetFiles(folderPath, "*.jpg") Dim countFaster As Integer = 0 Dim stopwatch As Stopwatch = Stopwatch.StartNew() For Each file In pdfFiles ' Read the barcode Dim results = BarcodeReader.Read(file, optionsFaster) If results.Any() Then Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}") For Each result In results Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}") countFaster += 1 Next Else Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}") End If Next stopwatch.Stop() ' Print number of images the barcode reader could decode Console.WriteLine($"Detailed could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms") $vbLabelText $csharpLabel Detailedオプションは、5分30秒で430件中237件のバーコード結果を検出しました。 劣化の激しい BarCode での成功率は 55.11%で、その精度の高さを実証しています。 ただし、処理時間が大幅に増加するため、このオプションは劣化した BarCode 画像専用に使用する必要があります。 不完全な BarCode を扱う場合は、imperfect barcode handling example を参考にしてください。 どのような状況で極限まで詳細なスピードが要求されますか? ExtremeDetail設定は、バーコード画像に重い処理を適用し、読み取りパフォーマンスを大幅に低下させます。 このCPU負荷の高いオプションは、1つの入力ファイル内で複数の不鮮明または不鮮明なBarCodeをスキャンする場合に最適です。他のオプションで望ましい結果が得られない場合の最後の手段として使用してください。 大量処理のシナリオでは、PDF ファイルから BarCode を読み取ります。PDF ファイルにはページごとに複数のバーコードが含まれていることがよくあります。 ExtremeDetail設定を適用して、その影響を観察してみましょう。 :path=/static-assets/barcode/content-code-examples/how-to/reading-speed-option-extreme-detailed.cs using IronBarCode; using System; using System.Diagnostics; using System.IO; using System.Linq; var optionsFaster = new BarcodeReaderOptions { Speed = ReadingSpeed.ExtremeDetail }; // Directory containing PDF files string folderPath = @"YOUR_FILE_PATH"; // Get all PDF files in the directory var pdfFiles = Directory.GetFiles(folderPath, "*.jpg"); int countFaster = 0; var stopwatch = Stopwatch.StartNew(); foreach (var file in pdfFiles) { // Read the barcode var results = BarcodeReader.Read(file, optionsFaster); if (results.Any()) { Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}"); foreach (var result in results) { Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}"); countFaster++; } } else { Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}"); } } stopwatch.Stop(); // Print number of images the barcode reader could decode Console.WriteLine($"ExtremeDetail could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms"); Imports IronBarCode Imports System Imports System.Diagnostics Imports System.IO Imports System.Linq Dim optionsFaster As New BarcodeReaderOptions With { .Speed = ReadingSpeed.ExtremeDetail } ' Directory containing PDF files Dim folderPath As String = "YOUR_FILE_PATH" ' Get all PDF files in the directory Dim pdfFiles = Directory.GetFiles(folderPath, "*.jpg") Dim countFaster As Integer = 0 Dim stopwatch As Stopwatch = Stopwatch.StartNew() For Each file In pdfFiles ' Read the barcode Dim results = BarcodeReader.Read(file, optionsFaster) If results.Any() Then Console.WriteLine($"Barcode(s) found in: {Path.GetFileName(file)}") For Each result In results Console.WriteLine($" Value: {result.Value}, Type: {result.BarcodeType}") countFaster += 1 Next Else Console.WriteLine($"No barcode found in: {Path.GetFileName(file)}") End If Next stopwatch.Stop() ' Print number of images the barcode reader could decode Console.WriteLine($"ExtremeDetail could read = {countFaster} out of {pdfFiles.Length} in {stopwatch.ElapsedMilliseconds}ms") $vbLabelText $csharpLabel ExtremeDetailオプションは、約430のバーコード画像のうち313を約10分で識別しました。 著しく劣化したBarCodeに対して72.79%という驚異的な精度を達成していますが、リソースの消費量が多いため、最後の手段としてのみ適しています。 このオプションを使用する前に、画像の前処理を検討してください。 異なる速度はどのように比較されますか? モード バーコードが見つかりました 平均時 ファイルあたりの時間 GC圧力 精度の向上 より速く。 147/430 (33.95%) 25秒 0.058秒 高(第2世代:177K) ベースライン バランスのとれた 237/430 (55.11%) 43秒 0.1秒 高(第2世代:151K) +62.32% 対 Faster 詳細 237/430 (55.11%) 5.50分 0.767秒 非常に高い (Gen2: 297K) +0% vs バランス エクストリームディテール 313/430 (72.79%) 10.14分 1.414秒 エクストリーム(第2世代:474万) +32.08% 対 詳細 自分のアプリケーションに適した速度を選択するにはどうすればよいですか? 上記の比較に基づき、Faster設定から始め、Balanced、Detailed、ExtremeDetailと進み、重要な出力の違いを特定してください。 ほとんどのシナリオでは、Balanced がすべてを適切に処理します。 DetailedとExtremeDetailは、大きく歪んだ画像にのみ使用してください。 DetailedとExtremeDetailは中程度と重度の処理を適用しますが、単一の処理を使用するよりも、バーコード読み取り前に手動で画像フィルタを適用するなど、処理を分割した方が効率的な場合もあります。 画像の前処理の詳細については、こちらのガイドを参照してください。 どの速度設定が私のユースケースにマッチしますか? . よくある質問 利用可能な4つのバーコード読み取り速度のオプションは何ですか? IronBarcodeは4つのReadingSpeedオプションを提供しています:Faster、Balanced、Detailed、ExtremeDetailです。各オプションは、処理速度と精度の異なるバランスを提供し、Balancedは、ほとんどのアプリケーションの出発点として推奨されています。 BarCode をスキャンする際の読み取り速度の設定方法を教えてください。 IronBarcodeのBarcodeReaderOptionsクラスを使って読み取り速度を設定することができます。新しいBarcodeReaderOptionsオブジェクトを作成し、Speedプロパティに希望のReadingSpeed値(Faster、Balanced、Detailed、ExtremeDetail)を設定し、Readメソッドに渡すだけです。 私のアプリケーションには、どの読解速度オプションを使用すればよいですか? IronBarcodeは、ほとんどのアプリケーションでバランス速度設定から始めることをお勧めします。高品質で鮮明なバーコード画像がある場合は、Fasterモードを使用することができます。劣化した画像や品質の低い画像の場合は、精度を高めるためにDetailedまたはExtremeDetailモードの使用を検討してください。 読解速度の違いによるトレードオフとは? IronBarcodeの読み取り速度は、処理速度と精度のトレードオフです。Fasterモードは画像を素早く処理しますが、画質の悪い画像ではバーコードを見逃す可能性があります。ExtremeDetailモードは最高の精度を提供しますが、より多くの処理時間とメモリリソースを必要とします。 異なる速度設定で複数のバーコード形式を読み取ることはできますか? はい、IronBarcodeは全ての速度設定でQRコードを含む様々なバーコードフォーマットの読み取りをサポートしています。速度設定は処理方法に影響しますが、読み取れるバーコードの種類を制限するものではありません。完全なリストはサポートされているバーコードフォーマットのページをご覧ください。 画質はどのように読書速度に影響しますか? 画像の品質はIronBarcodeのスピード選択に直接影響します。鮮明で高品質なバーコード画像は、Fasterモードで効率的に処理できます。劣化した、ぼやけた、または低コントラストの画像は、正確なバーコード検出と読み取りを確実にするために、DetailedまたはExtremeDetailモードが必要です。 速度オプションを使用して BarCode を読み取るための最小限のワークフローを教えてください。 IronBarcodeの最小ワークフローは5つのステップで構成されています:1) C#ライブラリのダウンロード、2) BarCodeReaderOptionsを使用して読み取り速度を設定、3) 画像パスを使用してReadメソッドを呼び出し、4) バーコード値を抽出して印刷、5) 異なる速度間のパフォーマンストレードオフを評価。 読む速度の違いによるパフォーマンスへの影響を測定するにはどうすればよいですか? IronBarcodeの異なる読み取り速度でのパフォーマンスは、.NETベンチマークライブラリを使用して測定し、処理時間とメモリ使用量を追跡することができます。これは、特定のユースケースとリソースの制約に最適な速度設定を特定するのに役立ちます。 カーティス・チャウ 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はできましたか? Nuget ダウンロード 2,070,733 | バージョン: 2026.2 リリース NuGet 無料版 総ダウンロード数: 2,070,733 ライセンスを見る