You are here: Start » FIL.NET » Function Reference » Computer Vision » Barcodes » FIL.RecognizeBarcode
Extracts information from a barcode located on the input image at a given position.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void RecognizeBarcode ( FilNet.Image inImage, FilNet.Rectangle2D inBarcodePosition, FilNet.CoordinateSystem2D? inBarcodePositionAlignment, FilNet.BarcodeFormat? inBarcodeFormat, int inScanCount, int inScanWidth, float inMinStrength, float inSmoothingStdDev, FilNet.Polarity inPolarity, INullable<string> outDecodedText, out FilNet.BarcodeFormat? outBarcodeFormat, NullableRef<NullableValue<FilNet.Polarity>> outBarcodePolarity, NullableValue<FilNet.Rectangle2D> outAlignedBarcodePosition, IList<FilNet.Segment2D> diagScheduledScanSegments )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inBarcodePosition | FilNet.Rectangle2D | Position of the input image in which the barcode is located. | ||
![]() | inBarcodePositionAlignment | FilNet.CoordinateSystem2D? | Adjusts the barcode rectangle to the position of the inspected object. Default value: ftl::NIL. | ||
![]() | inBarcodeFormat | FilNet.BarcodeFormat? | EAN13 | Format of the barcode. Default value: EAN13. | |
![]() | inScanCount | int | <1, INF> | 5 | Number of parallel scans run until first successful read. Default value: 5. |
![]() | inScanWidth | int | <1, INF> | 5 | Width of the single scan. Default value: 5. |
![]() | inMinStrength | float | <0.0f, INF> | 5.0f | Minimal strength of an extracted edge. Default value: 5.0f. |
![]() | inSmoothingStdDev | float | <0.0f, INF> | 0.25f | Standard deviation of the gaussian smoothing applied to the profile extracted in each scan. Default value: 0.25f. |
![]() | inPolarity | FilNet.Polarity | Dark | Specifies whether code is darker or brighter than the background. Default value: Dark. | |
![]() | outDecodedText | FilNet.INullable<string> | Decoded barcode text or nothing if all of the scans failed. This parameter cannot be null. | ||
![]() | outBarcodeFormat | FilNet.BarcodeFormat? | Decoded barcode format or nothing if all of the scans failed. | ||
![]() | outBarcodePolarity | FilNet.NullableRef<FilNet.NullableValue<FilNet.Polarity>> | Decoded barcode polarity or nothing if all of the scans failed. Can be null to skip this parameter calculation. | ||
![]() | outAlignedBarcodePosition | FilNet.NullableValue<FilNet.Rectangle2D> | Can be null to skip this parameter calculation. | ||
![]() | diagScheduledScanSegments | System.Collections.Generic.IList<FilNet.Segment2D> | Scheduled scan segments. |
Examples
![]() Rotated barcode. |
![]() Low quality barcode printed on plastic foil. |
![]() Barcode on package wrapped in plastic foil. |
![]() Barcode on blurry image. |
![]() Barcode on standard 330ml can. |
![]() Barcode on reflective and wrapped surface. |
![]() EAN-13 with add-on 2 used to indicate a book edition. |
![]() EAN-13 with add-on 5 to give a suggestion for the price. |
Remarks
Minimal bar width requirement
To provide precise detection of the barcode width of the thinnest bar should be at least 1.5 pixels.
Depending on the barcode format guard or start/end code patterns must be readable.
Pharmacode usage
The pharmacode barcode type can be read correctly in both directions. To get results from both directions use a Pharmacode and PharmacodeInversed barcode types.
Before decoding a Pharmacode the code orientation angle is normalized to a range from -45° to 135° what makes the code decoding more stable

Results of reading using a different Pharmacode directions: Pharmacode = 23 and PharmacodeInversed = 16.
Using a relative coordinate systems
Read more about Local Coordinate Systems in Machine Vision Guide: Local Coordinate Systems.
Function Overrides
- RecognizeBarcode(Image, Rectangle2D, Int32, Int32, Single, Single, Polarity, INullable<String>, Nullable<BarcodeFormat>)
- RecognizeBarcode(Image, Rectangle2D, Nullable<CoordinateSystem2D>, Nullable<BarcodeFormat>, Int32, Int32, Single, Single, Polarity, INullable<String>, Nullable<BarcodeFormat>)
- RecognizeBarcode(Image, Rectangle2D, Nullable<CoordinateSystem2D>, Nullable<BarcodeFormat>, Int32, Int32, Single, Single, Polarity, INullable<String>, Nullable<BarcodeFormat>, NullableRef<NullableValue<Polarity>>, NullableValue<Rectangle2D>)
- RecognizeBarcode(Image, Rectangle2D, Nullable<CoordinateSystem2D>, Nullable<BarcodeFormat>, Int32, Int32, Single, Single, Polarity, INullable<String>, Nullable<BarcodeFormat>, Nullable<Polarity>, Rectangle2D, IList<Segment2D>)