Every ByteScout tool includes sampleVBScript source codes that you can find here or in the folder with installed ByteScout product. ByteScout Data Extraction Suite was created to assist barcode image preprocessing filters with barcode reader sdk in VBScript. 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.
This rich and prolific sample source code in VBScript for ByteScout Data Extraction Suite contains various functions and options you should do calling the API to implement barcode image preprocessing filters with barcode reader sdk. If you want to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. Check these VBScript sample code examples to see if they acknowledge to your needs and requirements for the project.
On our website you may get trial version of ByteScout Data Extraction Suite for free. Source code samples are included to help you with your VBScript application.
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 Data Extraction Suite Home Page
Explore ByteScout Data Extraction Suite Documentation
Explore Samples
Sign Up for ByteScout Data Extraction Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: