误报

This article was translated from English: Does it need improvement?
Translated
View the article in English

如何移除误报?

误报是包含一维条形码的文本文件中的一个问题:

  1. 告诉 IronBarcode 只读取您预期的条形码格式。完整的选项列表如下所示: 条码编码2. 启用 RemoveFalsePositive 属性。启用后,IronBarcode 将对输入图像进行略微放大或缩小,创建两个用于条码扫描的图像。然后,它会丢弃在两个图像中未找到的任何条码。注意:此过程较慢,但减少了误报结果。
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // By default, all barcode formats are scanned for.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Turn on remove false positive
    RemoveFalsePositive = true
};

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

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // By default, all barcode formats are scanned for.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Turn on remove false positive
    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)
VB   C#

原因

当复杂的背景图案看起来像条形码时,或者当噪声和伪影产生意外的标记而读取器误认为是有效条形码时,条形码读取可能会发生误报。