BarcodeParams Object (IBarcodeParams Interface)
This object allows you to tune the parameters of barcode block recognition. Each barcode block in layout has its own child object of BarcodeParams type. Besides, this object is passed as a subobject of the PageAnalysisParams object into ABBYY FineReader Engine layout analysis-recognition functions. Recognition functions use the barcode recognition parameters specified by barcode blocks' child objects of the BarcodeParams type, rather than those specified by the subobject of the PageAnalysisParams object passed to these functions.
Whenever a barcode block is created during layout analysis, the properties of its child object of the BarcodeParams type are initialized with the values of the BarcodeParams object properties passed to the layout analysis function. Properties of a barcode block which is created with the help of the AddNew method of the Layout object are set to reasonable defaults. See the description of a particular property for the information on its default value.
You can find useful recommendations on barcode processing in Recognizing Barcodes.
The BarcodeParams object is a persistent object. This means that the object's current state can be written to persistent storage on disk. Later, the object can be re-created by reading the object's state from persistent storage. The following methods provide persistence of the object: SaveToFile, and LoadFromFile.
Properties
Name | Type | Description |
---|---|---|
Application | Engine, read-only | Returns the Engine object. |
Main settings | ||
EnableBarcodesCheck | VARIANT_BOOL |
Specifies whether the barcodes checking classifier can be used. This classifier verifies if there are barcodes on the image. This property does not work with the postal barcodes. The default value of this property is TRUE. |
MinRatioToTextHeight | double | This property is deprecated and will be deleted in future versions. |
Orientation | int |
The value of this property is an OR superposition of the BarcodeOrientationEnum enumeration constants which denote the types of barcode orientation. For example, if it is set to BO_Left_To_Right | BO_Down_To_Top, ABBYY FineReader Engine will presume that barcode blocks may be oriented either from left to right or from down to top, ignoring all other variants. By default, this property is set to BO_Autodetect, i.e., ABBYY FineReader Engine will detect the barcode orientation automatically. |
Type | int |
The value of this property is an OR superposition of the BarcodeTypeEnum enumeration constants which denote the types of barcodes. For example, if it is set to BT_EAN13 | BT_EAN8, ABBYY FineReader Engine will try to recognize barcode blocks in either EAN 13 or EAN 8 standard, ignoring all other variants. By default, this property is set to BT_Autodetect, i.e., ABBYY FineReader Engine will detect the barcode type automatically. Note: The default value allows detecting barcodes of all supported types. However, we recommend excluding IATA 2 of 5, Interleaved 2 of 5, and Matrix 2 of 5 barcode types unless you are certain that they will occur on your images. Barcodes of these types do not have a checksum and can therefore be mistakenly found on image areas that do not actually contain any barcodes. |
Settings for certain barcode types | ||
CodePage | CodePageEnum |
This property is used to recognize PDF417, Aztec, Data Matrix, QR Code, MaxiCode barcodes which do not conform to the barcode specifications. Do not use this property for barcodes created in conformity with the barcode specifications. Some barcode printers use code pages other than the one required by the specifications. In this case, use this property to specify the code page which was used by the barcode printer to create the barcode. In most cases, this will be the code page of the operating system under which the barcode printer was running. Note: The following code pages are required by the specifications:
The property is used to convert recognized data to a Unicode string. By default, this property is set to CP_Null, which means that the code page required by the specification should be used. |
ContainsBinaryData | VARIANT_BOOL |
This property makes sense only for PDF417, Aztec, Data Matrix, QR Code barcodes which encode some binary data. The property affects the way binary data is represented in the recognized text. If this property is set to TRUE, the binary data encoded in a barcode is saved as a sequence of hexadecimal values for corresponding bytes. If this property is FALSE, the binary data is translated to the Unicode string using the code page specified in the CodePage property. Note: Barcode symbols which correspond to binary data have the IBarcodeSymbol::IsBinaryData property set to TRUE. By default, the value of this property is FALSE. |
EnableAdvancedExtractionMode | VARIANT_BOOL | This property is deprecated and will be deleted in future versions. |
HasChecksum | VARIANT_BOOL |
Specifies whether the barcode being recognized must be interpreted as the barcode of the same type but with a checksum. This property is only available for barcodes of types Code 39, Interleaved 2 of 5, Codabar, and Matrix 2 of 5. Note: While Codabar has no check digit, ABBYY FineReader Engine uses an algorithm for computing check digits according to Modulo 16. The check digit is computed as follows. Each Codabar character has a value assigned to it. The sum of all character values is taken, including the Start and the Stop characters. The data character whose value, when added to this sum, equals a multiple of 16 is the check digit. By default, this property is set to FALSE. |
IsCode39WithoutAsterisk | VARIANT_BOOL | This property is deprecated and will be deleted in future versions. |
SupplementType | int |
The value of this property is an OR superposition of the BarcodeSupplementTypeEnum enumeration constants. This property is only available for barcodes of the EAN 8, 13, UPC-A, and UPC-E types. For example, if it is set to BS_Void | BS_2Digits, ABBYY FineReader Engine will try to recognize barcode blocks either without supplementary barcode or with 2-digit supplementary barcode. By default, this property is set to BS_Autodetect, i.e., ABBYY FineReader Engine will detect the supplementary barcode type automatically. |
Methods
Name | Description |
---|---|
CopyFrom | Initializes properties of the current object with values of similar properties of another object. |
LoadFromFile | Restores the object contents from a file on disk. |
SaveToFile | Saves the object contents into a file on disk. |
Related objects
Output parameter
This object is the output parameter of the CreateBarcodeParams method of the Engine object.
Input parameter
This object is passed as an input parameter to the following methods:
- ExtractBarcodes method of the FRPage object
See also
Tuning Parameters of Preprocessing, Analysis, Recognition, and Synthesis
03.07.2024 8:50:25