誤検知
誤検知を削除する方法は?
バーコード読み取りにおける誤検出は、複雑な背景パターンがバーコードのように見えてしまう場合や、ノイズやアーティファクトが意図しないマークを作成し、読み取り装置がそれを有効なバーコードと誤って認識する場合に発生することがあります。 以下の手順を実行して、IronBarcodeの読み取り出力から誤検知を除去できます。
-
IronBarcodeに期待されるバーコードフォーマットのみを読み取るように指示してください。 オプションの完全なリストはこちらに示されています:バーコードエンコーディング.
RemoveFalsePositive
プロパティを有効にします。 バーコードをスキャンする際、IronBarcodeは画像内で最もバーコードらしい「候補」領域を探し、その領域のデコードを試みます。 これをtrue
に設定することで、IronBarcode はエンコードにエラーのない領域のみをデコードしようとします。 デフォルトでは、RemoveFalsePositive
はすでにtrue
に設定されています。
using IronBarCode;
BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
// Expect and return barcode results for only the Code 39 type.
ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
// Remove false positives.
RemoveFalsePositive = true
};
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
using IronBarCode;
BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
// Expect and return barcode results for only the Code 39 type.
ExpectBarcodeTypes = IronBarCode.BarcodeEncoding.Code39,
// Remove false positives.
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)