VOOZH about

URL: https://ironsoftware.com/csharp/barcode/troubleshooting/false-positives/

⇱ Avoiding False Positives in Barcode Scanning


Skip to footer content

On This Page

  1. IronBarcode
  2. Troubleshooting
  3. False Positives

False Positives

How to Remove False Positives?

False positives in barcode reading can occur when complex background patterns resemble barcodes or when noise and artifacts create unintended marks that the reader mistakenly identifies as valid barcodes. The following steps can be taken to remove false positives from IronBarcode's reading output:

  1. Specify Expected Barcode Formats: Configure IronBarcode to read only the barcode formats you expect. A complete list of options is available here: BarcodeEncoding.

  2. Enable the RemoveFalsePositive Property: When scanning for barcodes, IronBarcode searches for "candidate" regions in an image that most likely resemble a barcode, then attempts to decode those regions. By setting this property to true, IronBarcode will only decode regions that have no errors in their encoding. By default, RemoveFalsePositive is already set to 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
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 2,287,186 | Version: 2026.6 just released

Still Scrolling?

Want proof fast? PM > Install-Package BarCode
run a sample watch your string become a barcode.

Try IronBarcode for Free
Get Set Up in 5 Minutes
Install with NuGet
Version: 2026.6
Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
Download DLL
Version: 2026.6
Download Now
Manually install into your project
  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"
Licenses from $749

Have a question? Get in touch with our development team.

Now you've installed with Nuget
Your browser is now downloading IronBarcode

Next step: Start free 30-day Trial

No credit card required

  • Test in a live environment
  • Fully-functional product
  • 24/5 technical support

Thank You

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:
πŸ‘ badge_greencheck_in_yellowcircle
The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Have a question? Get in touch with our development team.
No credit card or account creation required
Now you've installed with Nuget
Your browser is now downloading IronBarcode

Next step: Start free 30-day Trial

No credit card required

  • Test in a live environment
  • Fully-functional product
  • 24/5 technical support
Thank you.
View your license options:
Thank you.
If you'd like to speak to our licensing team:
Have a question? Get in touch with our development team.
Have a question? Get in touch with our development team.
Talk to Sales Team

Book a No-obligation Consult

How we can help:
  • Consult on your workflow & pain points
  • See how other companies solve their .NET document needs
  • All your questions answered to make sure you have all the information you need. (No commitment whatsoever.)
  • Get a tailored quote for your project's needs
Get Your No-Obligation Consult

Complete the form below or email sales@ironsoftware.com

Your details will always be kept confidential.

Trusted by Millions of Engineers Worldwide
Book Free Live Demo

Book a 30-minute, personal demo.

No contract, no card details, no commitments.

Here's what to expect:
  • A live demo of our product and its key features
  • Get project specific feature recommendations
  • All your questions are answered to make sure you have all the information you need.
    (No commitment whatsoever.)
CHOOSE TIME
YOUR INFO
Book your free Live Demo

Trusted by Millions of Engineers Worldwide

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me