假陽性
This article was translated from English: Does it need improvement?
TranslatedView 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,002,059 | 版本: 2025.12 剛發表






