You are here: Start » Program Examples » Bars
Bars
Aim:
Reads a barcode with a basic 1D Edge Detection filter.
Input:
An image containing an EAN13 barcode.
Output:
The decoded barcode.
Solution (FIS):
- Add the LoadImage filter to the ACQUIRE section in to load a single image from a file.
-
Add the ScanMultipleStripes filter to detect the stripes that create the barcode.
- Click the "..." button at the inScanPath input to open the GUI for drawing scanning paths. Draw a horizontal path that intersects the stripes roughly at the vertical center of the stripes. The path shouldn't be longer than the bright rectangle that contains the barcode and have the same length as the image width. Click OK to close the GUI.
- Set the inScanWidth parameter to 15.
- In the filter parameters, set the value of ProfileInterpolation to Quadric3. Make sure the StripePolarity parameter is set to Any.
- Click on Show/Hide Ports at the bottom of the filter and check the Width option in the outStripes submenu. This will allow you to see the width of the detected stripes.
-
Add the DecodeBarcode filter to read the barcode. Connect it to the outStripes.Width output of the ScanMultipleStripes.
- Set the inBarcodeFormat parameter to EAN13.
- Show the decoded text in a new preview window.
Macrofilter Main
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
DecodeBarcode | Decoding of barcodes whose bars have been measured in a non-standard way. |
![]() |
LoadImage | Loads a single image from a file. |
![]() |
ScanMultipleStripes | Very fast detection of multiple pairs of opposite edges - usually for counting or width measurements. |