False Positives

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.
    }
}
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
Curtis Chau
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

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

準備はいいですか?
Nuget ダウンロード 1,935,276 | バージョン: 2025.11 ただ今リリースされました