誤判
This article was translated from English: Does it need improvement?
Translated
View the article in English
如何移除誤判?
BARCODE讀取中的誤判可能發生在:當複雜的背景圖案與BARCODE相似,或當雜訊與干擾產生的意外標記被讀取器誤判為有效BARCODE時。 可採取以下步驟,從 IronBarcode 的讀取輸出中移除誤判:
-
指定預期的 BARCODE 格式:設定 IronBarcode 僅讀取您預期的 BARCODE 格式。 完整選項清單請參閱此處:BarcodeEncoding。
- 啟用
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

