IronBarcode와 함께 C#에서 읽기 속도를 조정하는 방법
IronBarcode는 네 가지 읽기 속도 옵션(Faster, Balanced, Detailed, ExtremeDetail)을 제공하여 C#에서 바코드를 읽을 때 처리 속도와 정확성 간의 균형을 제어할 수 있으며, Balanced가 대부분의 애플리케이션에 권장되는 시작점입니다.
소개
대량의 바코드를 읽을 때는 정확성이 필수적이지만, 자원 할당과 처리 효율성도 똑같이 중요한 고려 사항입니다. 입력 이미지의 품질은 바코드 리더가 이를 어떻게 처리해야 하는지를 결정합니다. 명확한 이미지의 경우 전처리를 건너뛰거나, 손상된 바코드의 정확성을 향상시키기 위해 더 많은 리소스를 사용하는 옵션을 사용할 수 있습니다.
IronBarcode는 처리 속도와 정확도 수준을 선택할 수 있는 유연성을 제공하여 바코드 읽기 프로세스의 모든 측면을 제어할 수 있습니다. 입력 이미지와 사용 가능한 자원에 따라 결정을 내릴 수 있습니다. 보다 고급 바코드 읽기 시나리오를 위해, 여러 포맷과 기법을 다루는 포괄적인 바코드 읽기 튜토리얼을 탐색하십시오.
이 문서는 다양한 시나리오에 대한 최적의 읽기 속도 선택 가이드라인을 제공합니다. 읽기 속도를 변경하는 것이 결과에 어떤 영향을 미치는지 QR 코드 샘플을 사용해 설명할 것입니다. QR 코드를 특정 작업에 사용할 경우, 테스트 샘플 생성을 위한 C# QR 코드 생성기 튜토리얼을 확인하십시오.
빠른 시작: 균형 잡힌 속도로 바코드 읽기IronBarcode의 BarcodeReaderOptions을 사용하여 스캔에 대한 Speed 수준을 즉시 설정하십시오. 이 예제는 빠르고 신뢰할 수 있는 결과를 위해 Balanced 설정을 사용하여 바코드를 빠르게 읽는 방법을 보여줍니다.
-
1IronBarcode를 NuGet Package Manager로 설치하십시오
-
2다음 코드 조각을 복사하여 실행하세요.
var results = IronBarCode.BarcodeReader.Read("path/to/image.png", new IronBarCode.BarcodeReaderOptions { Speed = IronBarCode.ReadingSpeed.Balanced });Dim results = IronBarCode.BarcodeReader.Read("path/to/image.png", New IronBarCode.BarcodeReaderOptions With {.Speed = IronBarCode.ReadingSpeed.Balanced})Dim results = IronBarCode.BarcodeReader.Read("path/to/image.png", New IronBarCode.BarcodeReaderOptions With {.Speed = IronBarCode.ReadingSpeed.Balanced}) -
3실제 운영 환경에서 테스트할 수 있도록 배포하세요.
오늘 프로젝트에서 IronBarcode 사용을 시작해보세요 무료 체험
최소 워크플로우(5단계)
- 읽기 속도를 조정하기 위해 C# 라이브러리를 다운로드하십시오
- BarcodeReaderOptions 클래스를 사용하여 읽기 속도를 설정하십시오
Read메서드를 사용하여 다양한 이미지 형식에서 바코드 값을 추출하세요- 바코드 값을 출력하세요
- 다양한 읽기 속도 간의 성능 상충관계를 평가하십시오
다양한 읽기 속도 옵션은 무엇인가요?
IronBarcode는 네 가지 ReadingSpeed 옵션: Faster, Balanced, Detailed 및 ExtremeDetail을 제공합니다. 각 옵션의 의도된 용도와 자체 이미지에 대해 속도와 정확성을 측정하는 방법을 살펴보겠습니다. 지원되는 형식의 전체 목록은 지원되는 바코드 형식 페이지를 방문하십시오.
처리 시간, 정확성 및 메모리 사용은 데이터셋, 하드웨어 및 이미지 품질에 크게 의존하기 때문에, 이 가이드는 고정된 벤치마크 숫자를 공개하지 않습니다. 대신, 아래의 각 옵션이 어떤 트레이드 오프를 제시하는지, 이를 사용해야 할 때는 무엇인지 설명합니다. 자신만의 이미지를 대표 샘플로 사용하여 .NET 벤치마크 라이브러리와 간단한 바코드 성공적으로 읽기 카운트 방법을 사용하여 옵션을 측정하십시오. 리더 옵션을 구성하는 방법에 대한 자세한 내용은 바코드 리더 설정 예제를 참조하십시오.
빠른 속도 옵션을 언제 사용해야 하나요?
Faster 옵션은 최소한의 리소스로 가장 빠른 바코드 읽기를 제공하지만 정확성을 감소시킵니다. 이 프로세스는 이미지 전처리를 건너뛰며, 입력 이미지가 이미 선명하고 명확할 때 가장 잘 작동합니다.
이 예제는 Speed 속성을 ReadingSpeed.Faster로 설정하고 바코드 디렉토리를 가져와서 각각의 이미지에 대해 바코드의 값을, 유형을, 개수를 프린트합니다. 다양한 이미지 형식에서 바코드를 읽는 것을 더 잘 이해하기 위해, 이미지에서 바코드 읽기 가이드를 확인하십시오.
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");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")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")Faster 옵션은 전처리를 완전히 건너뛰므로 네 가지 설정 중에서 가장 빠르고 오버헤드가 적지만, 다른 옵션들에 비해 품질이 저하되거나 낮은 바코드를 놓치는 비율이 상당히 높습니다. 깨끗한 이미지 조건에만 적합합니다. 단일 이미지에 여러 바코드가 있을 때, 다중 바코드 읽기 가이드를 통해 최적의 구성을 고려하십시오.
균형 잡힌 속도가 권장되는 이유는 무엇인가요?
Balanced 옵션은 정확성과 읽기 성능을 균형 맞춥니다. IronBarcode는 바코드 영역을 명확히 하기 위해 가벼운 이미지 처리를 적용하여 감지 및 판독이 더 쉽게 이루어집니다. 가벼운 처리는 일반적으로 정확한 결과를 제공하기 때문에 대부분의 현대 이미지에 권장됩니다.
같은 이미지를 사용하여 Balanced이 출력 결과에 미치는 영향을 시연해 보겠습니다. 비동기 작업에 대해서는 IronBarcode와의 비동기 및 멀티스레딩 가이드를 탐색하십시오.
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");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")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")Balanced 옵션은 약간의 전처리를 적용하여 손상된 이미지에서 Faster보다 의미 있게 더 나은 검출율을 제공합니다. 이 옵션은 메모리와 속도 간의 효율적인 균형을 유지하여 대부분의 상황에서 이상적이며 권장되는 시작점입니다. 이 균형 잡힌 접근법은 적절한 이미지 전처리 기술과 특히 잘 작동합니다.
Detailed 속도 옵션가 필요한 때는 언제인가요?
이미지가 심하게 흐릿하거나 왜곡되고 Balanced이 명확한 결과를 내지 못할 때, Detailed 옵션을 사용하십시오. 바코드 영역을 명확히 하고 디지털 노이즈를 줄여 더 나은 감지를 위해 중간 전처리를 적용합니다. 심각하게 손상된 이미지를 위해, 다양한 전처리 기술을 다루는 이미지 보정 가이드를 참조하십시오.
Detailed 설정을 적용하여 그 효과를 관찰해 보겠습니다.
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");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")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")Detailed 옵션의 중간 전처리는 Balanced에 비해 처리 시간이 상당히 늘어나지만, 모든 데이터셋에서 감지 개선을 보장하지는 못합니다. 이를 채택하기 전에 Balanced와 비교하여 자신의 이미지를 테스트해 보십시오. 추가된 비용으로 인해, 이 옵션은 손상된 바코드 이미지에만 사용해야 합니다. 불완전한 바코드를 처리할 때, 추가 전략을 위한 불완전한 바코드 처리 예제를 참조하십시오.
어떤 상황에서 ExtremeDetail 속도가 필요한가요?
ExtremeDetail 설정은 바코드 이미지에 대해 무거운 처리를 적용하여 읽기 성능을 크게 감소시킵니다. 이 CPU 집약적인 옵션은 하나의 입력 파일에 불명확하거나 흐릿한 여러 바코드를 스캔하는 데 가장 적합합니다. 다른 옵션들이 원하는 결과를 내지 못할 때 최후의 수단으로 사용하십시오. 고용량 처리 시나리오에서는 페이지당 여러 바코드를 포함하는 경우가 많은 PDF 파일에서 바코드 읽기를 탐구하십시오.
ExtremeDetail 설정을 적용하여 그 영향을 관찰해 보겠습니다.
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");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")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")ExtremeDetail 옵션은 네 가지 설정 중에서 가장 무거운 전처리를 적용하여 심하게 손상된 이미지에서 다른 옵션이 놓친 바코드를 복구할 수 있지만, 처리 시간과 메모리 오버헤드가 상당히 높아 마지막 수단으로만 적합합니다. 이 옵션을 사용하기 전에 이미지를 전처리하는 것을 고려하십시오.
다양한 속도의 비교는 어떻게 이루어지나요?
아래 표는 상대적, 질적 비교로, 실제 개수, 시간 및 메모리 사용은 전적으로 데이터셋, 하드웨어 및 이미지 품질에 의존하므로, 여기에 고정된 수치는 공개되지 않습니다. 프로덕션에 사용할 옵션을 선택하기 전에 자신의 이미지의 대표 샘플에 대해 옵션을 벤치마킹하십시오.
| 모드 | 상대 속도 | 상대 메모리 사용 | 최적의 용도 |
|---|---|---|---|
| Faster | 가장 빠름 | 가장 낮음 | 깨끗한, 고품질 이미지 |
| Balanced | 빠름 | 낮음 | 대부분의 애플리케이션(권장 기본값) |
| Detailed | 느림 | 높음 | 품질 저하가 중간 정도인 이미지 |
| ExtremeDetail | 가장 느림 | 가장 높음 | 심각하게 손상된 이미지, 최후의 수단으로 |
내 응용 프로그램에 맞는 적절한 속도 선택 방법
위의 비교를 기반으로 Faster 설정으로 시작하여 Balanced, Detailed 및 ExtremeDetail를 진행하며 중요한 출력 차이를 식별하십시오. 대부분의 시나리오에서, Balanced이 모든 것을 적절히 처리합니다. 심하게 왜곡된 이미지에만 Detailed 및 ExtremeDetail를 사용하십시오. 얇거나 저품질의 바코드에 대해서는 검출 민감도를 높이기 위해 속도 설정과 MinScanLines = 1을 결합하십시오.
Detailed 및 ExtremeDetail이 중간 및 무거운 처리를 적용하더라도, 종종 프로세스를 나누어 수동으로 이미지 필터를 적용한 후 바코드 읽기를 하는 것이 더 효율적일 수 있습니다. 이미지를 전처리하는 방법에 대한 자세한 내용은 이 가이드를 참조하십시오.
내 사용 사례에 맞는 속도 설정은 무엇인가요?

자주 묻는 질문
IronBarcode에서 제공하는 다양한 읽기 속도 옵션은 무엇인가요?
IronBarcode는 네 가지 읽기 속도 옵션을 제공합니다: Faster, Balanced, Detailed, ExtremeDetail. 각 옵션은 속도와 정확성에 따라 다른 요구를 충족시키며, 사용자가 특정 요구 사항에 따라 성능을 최적화할 수 있도록 합니다.
왜 Balanced 옵션이 바코드 읽기에 추천되나요?
Balanced 옵션은 속도와 정확성의 균형을 맞추기 위해 가벼운 이미지 처리를 적용하기 때문에 추천됩니다. 이는 대부분의 현대적이고 깨끗한 이미지에 적합하며, 리소스 소비를 크게 증가시키지 않으면서 신뢰할 수 있는 결과를 제공합니다.
Faster 속도 옵션은 언제 사용해야 하나요?
Faster 속도 옵션은 깨끗하고 고품질의 바코드 이미지를 사용할 때 권장됩니다. 이 설정은 이미지의 전처리를 건너뛰어 가장 빠른 처리 시간과 최소한의 리소스 사용을 제공하지만, 완벽하지 않은 이미지에 대해 정확도가 떨어질 수 있습니다.
Detailed 옵션은 바코드 감지를 어떻게 향상시키나요?
Detailed 옵션은 바코드 영역을 강화하고 디지털 노이즈를 줄이기 위해 중간 수준의 전처리를 적용하여, Balanced 옵션으로 충분하지 않은 중간 수준으로 열화되거나 흐릿한 이미지에 이상적입니다.
어떤 시나리오에 ExtremeDetail 속도 설정이 적합한가요?
ExtremeDetail 설정은 다른 옵션들이 만족스러운 결과를 생성하지 못하는 심각하게 열화되거나 흐릿한 바코드에 가장 적합합니다. 이는 리소스 사용을 상당히 증가시키는 무거운 전처리를 적용하므로, 최후의 수단으로만 사용해야 합니다.
바코드 읽기 요구에 맞는 적절한 속도 옵션을 어떻게 선택하나요?
Faster 설정으로 시작하여 Balanced, Detailed, ExtremeDetail로 진행하면서 출력 차이를 평가하십시오. 대부분의 애플리케이션은 Balanced 설정의 혜택을 받을 것입니다. 더욱 왜곡된 이미지에 대해 Detailed와 ExtremeDetail을 사용하십시오.
IronBarcode를 사용하기 전에 이미지를 수동으로 전처리할 수 있나요?
예, IronBarcode를 사용하기 전에 수동으로 이미지 전처리를 적용하는 것이 특히 저품질 바코드를 다룰 때 더 효율적일 수 있습니다. 이를 통해 이미지 품질 향상에 대한 더 나은 제어가 가능합니다.
읽기 속도 설정이 메모리 사용에 어떻게 영향을 끼칠 수 있나요?
IronBarcode의 각 읽기 속도 설정은 속도, 정확성 및 메모리 사용 간의 균형을 맞춥니다. Faster는 가장 적은 메모리를 사용하고, ExtremeDetail은 무거운 처리를 수행하기 때문에 가장 많은 메모리를 요구합니다.
ExtremeDetail 설정에서 무거운 처리를 적용할 때의 영향은 무엇인가요?
ExtremeDetail 설정은 집중적인 이미지 전처리와 인해 읽기 성능을 크게 낮추고 CPU 사용을 증가시킵니다. 이는 특히 고도로 열화된 이미지에서 다른 설정보다 특정 바코드를 더 효과적으로 복구할 수 있습니다.
고용량 처리에 어떤 바코드 읽기 속도 설정을 사용해야 하나요?
고품질 이미지와 함께 대량 처리에 대해서는 속도와 낮은 리소스 소비로 인해 Faster 설정이 최적입니다. 그러나 이 설정이 필요를 충족시키는지 확인하기 위해 특정 데이터 세트를 테스트하는 것이 중요합니다.
커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.