假阳性
This article was translated from English: Does it need improvement?
Translated
View the article in English
如何消除误报?
条形码读取中的误报可能发生在复杂的背景图案与条形码相似,或者噪声和伪影造成读取器错误识别为有效条形码的意外标记时。 以下步骤可用于消除 IronBarcode 读取输出中的误报:
1.指定预期条形码格式:配置 IronBarcode 以仅读取您预期的条形码格式。 完整的选项列表请参见: 条形码编码。
- 启用
RemoveFalsePositive属性:在扫描 BARCODE 时,IronBarcode 会在图像中搜索最可能类似 BARCODE 的"候选"区域,然后尝试解码这些区域。 将此属性设置为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,240,258 | 版本: 2026.5 just released

