误报

2022年一月19日
更新 2024年十二月17日
分享:
This article was translated from English: Does it need improvement?
Translated
View the article in English

如何消除误报?

在条码读取中,当复杂的背景图案看起来像条形码,或者当噪声和杂质产生意外的标记,读取器误将其视为有效的条形码时,可能会出现假阳性。 可以采取以下步骤来消除 IronBarcode 读取输出中的误报:

  1. 告诉IronBarcode只读取您期望的条码格式。 完整的选项列表显示在这里:BarcodeEncoding

  2. 启用RemoveFalsePositive属性。 在扫描条形码时,IronBarcode 会搜索图像中最有可能是条形码的 "候选 "区域,然后尝试对该区域进行解码。 通过将此设置为true,IronBarcode将仅尝试解码其编码中没有错误的区域。 默认情况下,RemoveFalsePositive 已经设置为 true
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // Expect and return barcode results for only the Code 39 type.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Remove false positives.
    RemoveFalsePositive = true
};

var results = BarcodeReader.Read("barcode.png", myOptionsExample);
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // Expect and return barcode results for only the Code 39 type.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Remove false positives.
    RemoveFalsePositive = true
};

var results = BarcodeReader.Read("barcode.png", myOptionsExample);
Imports IronBarCode

Private myOptionsExample As New BarcodeReaderOptions() With {
	.ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
	.RemoveFalsePositive = True
}

Private results = BarcodeReader.Read("barcode.png", myOptionsExample)
$vbLabelText   $csharpLabel