誤検知
偽陽性を削除する方法は?
バーコード読み取りで偽陽性が発生することがあります。これは、複雑な背景パターンがバーコードに似ている場合や、ノイズやアーティファクトが読取り機が誤って有効なバーコードと認識する意図しないマークを生成する場合です。 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.
}
}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 Class





