假陽性

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.
    }
}
$vbLabelText   $csharpLabel
柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 2,035,202 | 版本: 2025.12 剛剛發布