誤検知

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

偽陽性を削除する方法は?

バーコード読み取りで偽陽性が発生することがあります。これは、複雑な背景パターンがバーコードに似ている場合や、ノイズやアーティファクトが読取り機が誤って有効なバーコードと認識する意図しないマークを生成する場合です。 IronBarcodeの読み取り出力から偽陽性を削除するために、次の手順を実行できます。

  1. 期待されるバーコード形式を指定する: IronBarcodeを設定して、期待するバーコード形式のみを読み取るようにします。 オプションの完全なリストはここにあります: BarcodeEncoding

  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に精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はできましたか?
Nuget ダウンロード 2,108,094 | バージョン: 2026.3 リリース
Still Scrolling Icon

まだスクロールしていますか?

すぐに証拠が欲しいですか? PM > Install-Package BarCode
サンプルを実行する 文字列が BarCode になるのを見る。