False Positives

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

Wie entfernt man Falsch Positive?

Falsch positive Ergebnisse können beim Barcode-Lesen auftreten, wenn komplexe Hintergrundmuster Barcodes ähneln oder wenn Rauschen und Artefakte unbeabsichtigte Markierungen erzeugen, die der Leser fälschlicherweise als gültige Barcodes identifiziert. Die folgenden Schritte können unternommen werden, um falsch positive Ergebnisse aus der Ausgabe von IronBarcode zu entfernen:

  1. Erwartete Barcode-Formate angeben: Konfigurieren Sie IronBarcode so, dass nur die Barcode-Formate gelesen werden, die Sie erwarten. Eine vollständige Liste der Optionen ist hier verfügbar: BarcodeEncoding.

  2. Die RemoveFalsePositive-Eigenschaft aktivieren: Beim Barcode-Scannen sucht IronBarcode nach "Kandidaten"-Bereichen in einem Bild, die höchstwahrscheinlich einem Barcode ähneln, und versucht dann, diese Bereiche zu dekodieren. Indem Sie diese Eigenschaft auf true setzen, dekodiert IronBarcode nur Bereiche, die keine Fehler in ihrer Codierung aufweisen. Standardmäßig ist RemoveFalsePositive bereits auf true gesetzt.
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
Technischer Autor

Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender ...

Weiterlesen
Bereit anzufangen?
Nuget Downloads 1,935,276 | Version: 2025.11 gerade veröffentlicht