ByteScout Premium Suite - VBScript - Barcode image preprocessing filters with barcode reader sdk - ByteScout

ByteScout Premium Suite – VBScript – Barcode image preprocessing filters with barcode reader sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Barcode image preprocessing filters with barcode reader sdk

barcode image preprocessing filters with barcode reader sdk in VBScript using ByteScout Premium Suite

Learn barcode image preprocessing filters with barcode reader sdk in VBScript

These source code samples are assembled by their programming language and functions they use. ByteScout Premium Suite helps with barcode image preprocessing filters with barcode reader sdk in VBScript. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

Save time on writing and testing code by using the code below and use it in your application. Just copy and paste this VBScript sample code to your VBScript application’s code editor, add a reference to ByteScout Premium Suite (if you haven’t added yet) and you are ready to go! Use of ByteScout Premium Suite in VBScript is also described in the documentation included along with the product.

ByteScout Premium Suite free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.

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

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

TestBarcodeReading.vbs
      
' This exmaple demonstrates the use of image filters to improve the decoding or speed. Dim result Set reader = CreateObject("Bytescout.BarCodeReader.Reader") reader.RegistrationName = "demo" reader.RegistrationKey = "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) result = result & "Image ""low-contrast-barcode.png""" & vbCRLF reader.ReadFromFile "low-contrast-barcode.png" If reader.FoundCount = 0 Then result = result & "No barcode found!" & vbCRLF Else For i = 0 To reader.FoundCount - 1 result = result & "Found barcode with type " & CStr(reader.GetFoundBarcodeType(i)) & " and value """ & reader.GetFoundBarcodeValue(i) & """" & vbCRLF Next End If reader.ImagePreprocessingFilters.Clear() result = result & vbCRLF ' WORKING WITH NOISY BARCODE IMAGES ' Add the median filter to lower the noise reader.ImagePreprocessingFilters.AddMedian() result = result & "Image ""noisy-barcode.png""" & vbCRLF reader.ReadFromFile "noisy-barcode.png" If reader.FoundCount = 0 Then result = result & "No barcode found!" & vbCRLF Else For i = 0 To reader.FoundCount - 1 result = result & "Found barcode with type " & CStr(reader.GetFoundBarcodeType(i)) & " and value """ & reader.GetFoundBarcodeValue(i) & """" & vbCRLF Next End If reader.ImagePreprocessingFilters.Clear() result = result & vbCRLF ' 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(2) ' enlarge twice result = result & "Image ""too-dense-barcode.png""" & vbCRLF reader.ReadFromFile "too-dense-barcode.png" If reader.FoundCount = 0 Then result = result & "No barcode found!" & vbCRLF Else For i = 0 To reader.FoundCount - 1 result = result & "Found barcode with type " & CStr(reader.GetFoundBarcodeType(i)) & " and value """ & reader.GetFoundBarcodeValue(i) & """" & vbCRLF Next End If reader.ImagePreprocessingFilters.Clear() result = result & vbCRLF ' 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() result = result & "Image ""barcode-with-large-margins.png""" & vbCRLF reader.ReadFromFile "barcode-with-large-margins.png" If reader.FoundCount = 0 Then result = result & "No barcode found!" & vbCRLF Else For i = 0 To reader.FoundCount - 1 result = result & "Found barcode with type " & CStr(reader.GetFoundBarcodeType(i)) & " and value """ & reader.GetFoundBarcodeValue(i) & """" & vbCRLF Next End If reader.ImagePreprocessingFilters.Clear() result = result & vbCRLF Msgbox result Set reader = Nothing

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next