ByteScout Data Extraction Suite - VB.NET - Barcode image preprocessing filters with barcode reader sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Data Extraction Suite – VB.NET – Barcode image preprocessing filters with barcode reader sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – VB.NET – Barcode image preprocessing filters with barcode reader sdk

barcode image preprocessing filters with barcode reader sdk in VB.NET using ByteScout Data Extraction Suite

How to apply ByteScout Data Extraction Suite for barcode image preprocessing filters with barcode reader sdk in VB.NET

ByteScout tutorials describe the stuff for programmers who use VB.NET. ByteScout Data Extraction Suite helps with barcode image preprocessing filters with barcode reader sdk in VB.NET. ByteScout Data Extraction Suite is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

The below SDK samples describe how to quickly make your application do barcode image preprocessing filters with barcode reader sdk in VB.NET with the help of ByteScout Data Extraction Suite. Follow the steps-by-step instructions from the scratch to work and copy and paste code for VB.NET into your editor. Further improvement of the code will make it more robust.

Trial version along with the source code samples for VB.NET can be downloaded from our website

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Module1.vb
      
Imports Bytescout.BarCodeReader Module Module1 ''' <summary> ''' This exmaple demonstrates the use of image filters to improve the decoding or speed. ''' </summary> Sub Main() Using reader As New Reader("demo", "demo") ' Set barcode type to find reader.BarcodeTypesToFind.Code128 = True ' WORKING WITH LOW CONTRAST BARCODE IMAGES ' Add the contrast adjustment for the low contrast image reader.ImagePreprocessingFilters.AddContrast(40) Console.WriteLine("Image {0}", "low-contrast-barcode.png") ' ----------------------------------------------------------------------- ' NOTE: We can read barcodes from specific page to increase performance . ' For sample please refer to "Decoding barcodes from PDF by pages" program. ' ----------------------------------------------------------------------- Dim barcodes As FoundBarcode() = reader.ReadFrom("low-contrast-barcode.png") If barcodes.Length = 0 Then Console.WriteLine("No barcode found!") Else For Each barcode As FoundBarcode In barcodes Console.WriteLine("Found barcode {0} with value '{1}'", barcode.Type, barcode.Value) Next End If reader.ImagePreprocessingFilters.Clear() Console.WriteLine() ' WORKING WITH NOISY BARCODE IMAGES ' Add the median filter to lower the noise reader.ImagePreprocessingFilters.AddMedian() Console.WriteLine("Image {0}", "noisy-barcode.png") barcodes = reader.ReadFrom("noisy-barcode.png") If barcodes.Length = 0 Then Console.WriteLine("No barcode found!") Else For Each barcode As FoundBarcode In barcodes Console.WriteLine("Found barcode {0} with value '{1}'", barcode.Type, barcode.Value) Next End If reader.ImagePreprocessingFilters.Clear() Console.WriteLine() ' WORKING WITH DENSE AND ILLEGIBLE BARCODES ' Add the scale filter to enlarge the barcode to make gaps between bars more distinguishable reader.ImagePreprocessingFilters.AddScale(2) ' enlarge twice Console.WriteLine("Image {0}", "too-dense-barcode.png") barcodes = reader.ReadFrom("too-dense-barcode.png") If barcodes.Length = 0 Then Console.WriteLine("No barcode found!") Else For Each barcode As FoundBarcode In barcodes Console.WriteLine("Found barcode {0} with value '{1}'", barcode.Type, barcode.Value) Next End If reader.ImagePreprocessingFilters.Clear() Console.WriteLine() ' REMOVE EMPTY MARGINS FROM IMAGE TO SPEED UP THE PROCESSING ' Add the crop filter to cut off empty margins from the image. ' This will not improve the recognition quality but may speed up the processing ' if you enabled multiple barcode types to search. reader.ImagePreprocessingFilters.AddCropDark() Console.WriteLine("Image {0}", "barcode-with-large-margins.png") barcodes = reader.ReadFrom("barcode-with-large-margins.png") If barcodes.Length = 0 Then Console.WriteLine("No barcode found!") Else For Each barcode As FoundBarcode In barcodes Console.WriteLine("Found barcode {0} with value '{1}'", barcode.Type, barcode.Value) Next End If reader.ImagePreprocessingFilters.Clear() Console.WriteLine() End Using Console.WriteLine("Press any key to exit..") Console.ReadKey() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next