误报
This article was translated from English: Does it need improvement?
TranslatedView the article in English
如何消除误报?
在条码读取中,当复杂的背景图案看起来像条形码,或者当噪声和杂质产生意外的标记,读取器误将其视为有效的条形码时,可能会出现假阳性。 可以采取以下步骤来消除 IronBarcode 读取输出中的误报:
告诉IronBarcode只读取您期望的条码格式。 此处显示了完整的选项列表:条码编码.
- 启用
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)
VB C#