main content

barcode recognition using live video acquisition -凯发k8网页登录

this example shows how to use the from video device block to recognize a barcode.

image acquisition toolbox™ provides a simulink® block to acquire live image data from image acquisition devices into simulink models.

this example uses the from video device block to acquire live image data from the point grey flea® 2 camera into simulink. the example uses the computer vision toolbox™ 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 example requires simulink, computer vision toolbox and the point grey flea® 2 camera to open and run the model.

. (11 seconds)

example model

the following figure shows the example 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 example, the block acquires rgb frames from the camera and outputs them into the simulink model at every simulation time step.

algorithm

the barcode recognition example 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 example 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 example 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 example, 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.

网站地图