Today you are going to learn how to barcode image preprocessing filters in VBScript. ByteScout BarCode Reader SDK helps with barcode image preprocessing filters in VBScript. ByteScout BarCode Reader SDK is the SDK for barcode decoding. Can read all popular types from Code 128, GS1, UPC and Code 39 to QR Code, Datamatrix, PDF417. Images, pdf, TIF images and live web camera are supported as input. Designed to handle documents with noise and defects. Includes optional splitter and merger for pdf and tiff based on barcodes. Batch mode is optimized for high performance with multiple threads. Decoded values can be exported to XML, JSON, CSV or into custom data format.
VBScript, code samples for VBScript, developers help to speed up the application development and writing a code when using ByteScout BarCode Reader SDK. This VBScript sample code should be copied and pasted into your application’s code editor. Then just compile and run it to see how it works. Code testing will allow the function to be tested and work properly with your data.
Trial version can be downloaded from our website. Source code samples for VBScript and documentation are included.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
' 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
60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page
Explore ByteScout BarCode Reader SDK Documentation
Explore Samples
Sign Up for ByteScout BarCode Reader SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page
Explore ByteScout BarCode Reader SDK Documentation
Explore Samples
Sign Up for ByteScout BarCode Reader SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: