誤報

This article was translated from English: Does it need improvement?
Translated
View the article in English

如何消除偽陽性?

偽陽性是包含一維條碼的文本文件的問題:

  1. 指示 IronBarcode 僅讀取您預期的條碼格式。一個完整的選項列表顯示於此處: 條碼編碼.

  2. 啟用 RemoveFalsePositive 屬性。啟用後,IronBarcode 會稍微縮放輸入圖像,生成兩個掃描條碼的圖像。然後,它會捨棄在兩個圖像中未找到的任何條碼。注意:此過程較慢,但可減少假陽性結果。
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // By default, all barcode formats are scanned for.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Turn on remove false positive
    RemoveFalsePositive = true
};

var results = BarcodeReader.Read("barcode.png", myOptionsExample);
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // By default, all barcode formats are scanned for.
    ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,

    // Turn on remove false positive
    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#

原因

條碼讀取中的偽陽性可能會發生在複雜的背景圖案看起來像條碼時,或當噪點和伪影創建了無意的標記,而讀取器錯誤地將其視為有效條碼時。