- Home
- Purchase
- Developer Tools
- BarCode Generator SDK
- BarCode Generator SDK for Javascript for Code 128
- BarCode Reader SDK
- PDF Generator SDK for Javascript
- PDF Extractor SDK
- PDF Renderer SDK
- PDF To HTML SDK
- PDF Viewer SDK
- Spreadsheet SDK
- Image To Video SDK
- Screen Video Capturing SDK
- SWF To Video and Images SDK
- Images Watermarking SDK
- Document SDK beta
- Misc Tools
- Desktop Utilities
- Download
- Support
- Company
How to read barcode image from Web camera and decode it with Bytescout BarCode Reader SDK
BarCode Reader SDK and BarCode Reader free utility are capable of reading 1D and 2D barcodes from images fetched from a scanner or a web camera device.
DEVELOPERS: To load image from web-camera or scanner device into BarCode Reader SDK please use freeware Scan SDK (visit this page for free download). Scroll to the end of this tutorial to see ready-to-use source code snippets.
You can test how it works with BarCode Reader utility included into BarCode Reader SDK: run it, use Acquire Image button to load image from web-camera or scanner device.
Requirements for Web-Camera Devices:
- resolution 640x480 or higher;
Ability to change the focus (in MANUAL FOCUS mode). Usually such web camera devices have a ring around lenses which can be used to adjust the focus. Web camera devices with ability to change focus: Microsoft LifeCam VX-1000, Logitech QuickCam Pro 9000, Labtec Webcam 2200 and any other with manual focus support.
Why it's important to have Manual Focus in a Web Camera? Manual focus is required to get sharp image of the barcode. With autofocus web camera devices usually are not able to take sharp photo of the barcode.
- you should put the image with the barcode 2-3 inches before the web-camera;
- make sure you have a sharp image and the barcode is not cut on the picture.
STEP-BY-STEP TUTORIAL (for cheap Hercules Classic Link webcam)
Run BarCode Reader utility
Turn on web camera
Click Acquire Image

Web camera selection dialog will appear:

Select WIA-Hercules Classic Link and click Select.
Capture Pictures from Video dialog will appear:
You will preview the picture
Turn Manual Focus ring near the lens to get desired focus:
BAD (adjust Manual Focus to get barcode focused):

GOOD (after Manual Focus ring adjustments):

Now click Capture button and then Get Pictures button:

The image will be transferred to the BarCode Reader utility:

Click Decode All (1D and 2D) button to find and decode barcode:

You will see the utility found and decoded the barcode.
How to speed up decoding barcode images: you can speed up decoding by clicking Decode 1D only button or Decode 2D only button if you know the type of the barcode you have.
FOR SOFTWARE DEVELOPERS - here are the source code snippets to see how to scan and decode barcode from web camera (C# code):
- loading image from web-camera (the code called on Acquire Image button):
/// <summary> /// Starts Asynchronous scan into images. When scan is finished /// then scan_TransferFinished event is called and array with /// images objects is passed into this event /// </summary> private void startScan() { // create new Scan object Scan scan = new Scan(); // set Scan object to save images into images array // (will be passed as a parameter in scan_TransferFinished event scan.SaveTo = SaveTo.ImageObject; // set function for scan finished event to indicate when // image transfer is finished // see scan_TransferFinished event below scan.TransferFinished += scan_TransferFinished; // acquire images scan.AcquireImagesAsync(Handle); } // this event captures scanned images and fills images into tabs // you can also iterate through scannedImages array to get each // image as an Image object instead void scan_TransferFinished(Scan sender, ArrayList scannedImages) { List<string> files = new List<string>(); for (int i = 0; i < Math.Min(scannedImages.Count, 1); i++) { Image image = scannedImages[i] as Image; string s = scannedImages[i] as string; if (image != null) { string fileName = Path.GetTempFileName() + ".bmp"; image.Save(fileName); m_filesToDelete.Add(fileName); files.Add(fileName); } else if (s != null) files.Add(s); } m_images = files.ToArray(); m_currentImage = 0; updatePicture(); updateButtons(); }
- decoding the image from web-camera:
private void decodeImage() { enableButtons(false); m_result = null; SymbologyFilter filter = m_reader.TypeToFind; if (m_reader != null) m_reader.ReadFrom(m_images[m_currentImage]); } catch (Exception ex) { MessageBox.Show(ex.Message); } m_reader.TypeToFind = filter; m_lastDecodingTime = m_decodingForm.LastDecodingTime; updatePicture(); updateFound(); enableButtons(true); }
Filed in:
BarCode Reader SDK
? Should we port BarCode Reader SDK to Windows RT? Or make online web-service API?
Please vote now and help us select the new platform!
Tutorials:





