假阳性
This article was translated from English: Does it need improvement?
Translated
View the article in English
如何消除误报?
条形码读取中的误报可能发生在复杂的背景图案与条形码相似,或者噪声和伪影造成读取器错误识别为有效条形码的意外标记时。 以下步骤可用于消除 IronBarcode 读取输出中的误报:
1.指定预期条形码格式:配置 IronBarcode 以仅读取您预期的条形码格式。 完整的选项列表请参见: 条形码编码。
2.启用 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
$vbLabelText
$csharpLabel
准备开始了吗?
Nuget 下载 2,169,908 | 版本: 2026.4 刚刚发布

