誤検知
Curtis Chau
更新日: 2026年8月2日
偽陽性を削除する方法は?
バーコード読み取りで偽陽性が発生することがあります。これは、複雑な背景パターンがバーコードに似ている場合や、ノイズやアーティファクトが読取り機が誤って有効なバーコードと認識する意図しないマークを生成する場合です。 IronBarcodeの読み取り出力から偽陽性を削除するために、次の手順を実行できます。
- 期待されるバーコード形式を指定する: IronBarcodeを設定して、期待するバーコード形式のみを読み取るようにします。 オプションの完全なリストはここで確認できます: BarcodeEncoding。
RemoveFalsePositiveプロパティを有効にします: バーコードをスキャンするときに、IronBarcode は画像内でバーコードに似ている「候補」領域を探し、その領域をデコードしようとします。 このプロパティをtrueに設定すると、IronBarcode はエンコーディングにエラーがない領域のみをデコードします。 デフォルトで、RemoveFalsePositiveはすでにtrueに設定されています。
using IronBarCode;
class BarcodeExample
{
static void Main()
{
// Create a BarcodeReaderOptions object with specific parameters.
BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
// Expect and return barcode results for only the Code 39 type.
ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
// Enable removal of false positives by setting to true.
RemoveFalsePositive = true
};
// Read the barcode from the specified image file using the given options.
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
// Process the results here, e.g., display them, log them, etc.
}
}Imports IronBarCode
Friend Class BarcodeExample
Shared Sub Main()
' Create a BarcodeReaderOptions object with specific parameters.
Dim myOptionsExample As New BarcodeReaderOptions() With {
.ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
.RemoveFalsePositive = True
}
' Read the barcode from the specified image file using the given options.
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)
' Process the results here, e.g., display them, log them, etc.
End Sub
End ClassImports IronBarCode
Friend Class BarcodeExample
Shared Sub Main()
' Create a BarcodeReaderOptions object with specific parameters.
Dim myOptionsExample As New BarcodeReaderOptions() With {
.ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
.RemoveFalsePositive = True
}
' Read the barcode from the specified image file using the given options.
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)
' Process the results here, e.g., display them, log them, etc.
End Sub
End Classテクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。