Falsches Positivum
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:
-
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.
- Aktivieren Sie die Eigenschaft
RemoveFalsePositive: Beim Scannen nach Barcodes sucht IronBarcode in einem Bild nach "Kandidaten"-Bereichen, die am ehesten einem Barcode ähneln, und versucht dann, diese Bereiche zu dekodieren. Durch die Einstellung dieser Eigenschaft auftruedekodiert IronBarcode nur Regionen, die keine Kodierungsfehler aufweisen. Standardmäßig istRemoveFalsePositivebereits auftrueeingestellt.
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

