Fałszywe alarmy
Jak usunąć fałszywe alarmy?
Fałszywe alarmy podczas odczytu kodów kreskowych mogą wystąpić, gdy złożone wzory tła przypominają kody kreskowe lub gdy zakłócenia i artefakty tworzą niezamierzone znaki, które czytnik błędnie identyfikuje jako prawidłowe kody kreskowe. Aby usunąć fałszywe wyniki z odczytu IronBarcode, można podjąć następujące kroki:
-
Określ oczekiwane formaty kodów kreskowych: Skonfiguruj IronBarcode tak, aby odczytywał tylko te formaty kodów kreskowych, których oczekujesz. Pełna lista opcji jest dostępna tutaj: BarcodeEncoding.
- Włącz właściwość
RemoveFalsePositive: Podczas skanowania kodów kreskowych IronBarcode wyszukuje w obrazie obszary "kandydackie", które najprawdopodobniej przypominają kod kreskowy, a następnie próbuje je zdekodować. Ustawiając tę właściwość natrue, IronBarcode będzie dekodować tylko te obszary, które nie zawierają błędów w kodowaniu. DomyślnieRemoveFalsePositivejest już ustawione natrue.
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

