Image Acquisition Toolbox 3.4
Barcode Recognition Using Live Video Acquisition
Image Acquisition Toolbox™ provides a Simulink® block to acquire live image data from image acquisition devices into Simulink models.
This demo uses the From Video Device block to acquire live image data from the Point Grey Flea® 2 camera into Simulink. The demo uses the Video and Image Processing Blockset™ to create an image processing system which can recognize and interpret a GTIN-13 barcode. The GTIN-13 barcode, formally known as EAN-13, is an international barcode standard. It is a superset of the widely used UPC standard.
This demo requires Simulink, Video and Image Processing Blockset and the Point Grey Flea® 2 camera to open and run the model.
Contents
Watch barcode recognition on live video stream. (11 seconds)
Demo Model
The following figure shows the demo model using the From Video Device block.
Live Video Input
The input video is acquired live from a DCAM image acquisition device (Point Grey Flea® 2). In this demo, the block acquires RGB frames from the camera and outputs them into the Simulink model at every simulation time step.
Algorithm
The barcode recognition demo performs a search on some selected rows of the input image, called scan lines. The scan lines are analyzed per pixel and marked by feature. Once all pixels are marked with a feature value, the sequences of patterns are analyzed. The demo identifies the guard patterns and symbols by sequence and location. The symbols are up sampled and compared with the codebook to determine a corresponding code.
To compensate for various barcode orientations, the demo analyzes from left to right and from right to left and chooses the better match. If the check sum is correct and a matching score against the codebook is higher than a set threshold, the code is considered valid and is displayed.
You can change the number and location of the scan lines by changing the value of the “Row Positions Of Scan Lines” parameter.
Results
The scan lines that have been used to detect barcodes are displayed in red. When a GTIN-13 is correctly recognized and verified, the code is displayed in yellow.
Even though a Flea® 2 camera was used for this demo, this model can be easily updated to connect your models to other supported image acquisition devices. This provides you the flexibility to use the same Simulink model with different image acquisition hardware.
Store