IRONSOFTWAREHOME

偽陽性

Curtis Chau
Curtis Chau
Updated: 2026年4月22日

如何移除偽陽性?

在條碼讀取中,當複雜的背景圖案類似於條碼或者噪點及雜質造成未預期的標記,讀取器誤認為有效條碼時,可能會發生偽陽性。 可以採取以下步驟從IronBarcode的讀取輸出中移除偽陽性:

  1. **指定預期的條碼格式:**配置IronBarcode僅讀取您預期的條碼格式。 完整的選項列表可在此處找到:BarcodeEncoding

  2. 啟用RemoveFalsePositive屬性:在掃描條碼時,IronBarcode會尋找圖片中最可能類似條碼的"候選"區域,然後嘗試解碼這些區域。 通過將此屬性設置為true,IronBarcode只會解碼那些在編碼中沒有錯誤的區域。 在預設情況下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.
    }
}
Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

準備好開始了嗎?

Nuget Downloads 2,422,100版本:2026.9剛剛發布

立即獲取您的免費30天試用金鑰
不需要信用卡或帳戶建立
C# NuGet程式庫,用於PDF
通過NuGet安裝

版本: 2026.9

PM > Install-Package BarCode
nuget.org/packages/BarCode/
  1. 在解決方案資源管理器中,右鍵點擊References,管理NuGet包
  2. 選擇瀏覽並搜尋"IronBarCode"
  3. 選擇包並安裝
C# PDF DLL
下載DLL

版本: 2026.9

  1. 下載並解壓IronBarCode至您的Solution目錄中的~/Libs等位置
  2. 在Visual Studio解決方案資源管理器中右鍵點擊References,選擇瀏覽,"IronBarCode.dll"

$999起的授權費用

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預訂您的免費即時演示
Booking Badge

全球數百萬工程師信賴

Iron Software的客戶標誌
獲取您的無義務諮詢
完成下方表單或發送電子郵件至sales@ironsoftware.com
您的詳細資訊將始終保密。
全球數百萬工程師信賴
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立