CIB ocr technical manual (EN)

9. Properties Barcode-Recognition

BarcodeOutputFilename
BarcodeOutputType
BarcodeRegion
BarcodeRemoveChecksum
BarcodeShowPageNumber
BarcodeStopAfter
BarcodeType
BarcodeTimeout
BarcodeValue
BarcodeValueLength
DatamatrixAngleDeviation
DatamatrixShrinkingFactor
DatamatrixScanGap
DatamatrixThreshold
ZBarConfig

BarcodeOutputFilename

Property-Name 

Data-Type 

Type 

BarcodeOutputFilename 

String 

Set 

 

This property sets the name of the outputfile to which values of all barcodes found in the inputfile are written. 
The property BarcodeOutputFilename is optional, if it is empty - BarcodeValueLength  and BarcodeValue are used . 
For format/extension look at OutputFormat  

The format of this file is given by “BarcodeOutputType ”. 

Syntax 

BarcodeOutputFilename=<filename> 
<filename>:name.ext 

default=No input, BarcodeValueLength and BarcodeValue are used . 

 Example 

BarcodeOutputFilename=barcodes.txt 

BarcodeOutputType

Property-Name 

Data-Type 

Type 

BarcodeOutputType 

String 

Set 

 

This property defines whether the output should  be in memory or to file. 
This property is automatically set depending on whether BarcodeOutputFilename is set  or not. IBarcodeOutputFilename is set then BarcodeO utputType=File is set otherwise  BarcodeOutputType=Memory .   

 

Syntax 

BarcodeOutputType=<type> 
<type>: File | Memory  

default=File 

 

Example 

BarcodeOutputType=File 

BarcodeRegion

With this property it is set that a search for barcodes is only applied on defined rectangle. 

If a barcode is always situated on the same area of each page , performance is improved by limiting  the  search for barcodes to this area.  
Th is area (= rectangle) is defined by two basic points (left ,top and right,bottom).  
Point of origin is the top-left corner of the page,  the unit is  pixel 

 

Syntax 

BarcodeRegion=<rectangle> 
<rectangle>: <left> ";" <top> ";" <right> ";" <bottom> 

default=No input 

The whole page is scanned if no input is done or rectangle given by coordinates is empty. 

 

Example 

BarcodeRegion=10.5;50;100.0;200.5 

BarcodeRemoveChecksum

Property-Name 

Data-Type 

Type 

BarcodeRemoveChecksum 

String 

Set 

 

When this property is set, checksum is not considered  when reading a barcode. 

The property can be used for barcodes Code39 Code39Extended and Code128   

 

Syntax 

BarcodeRemoveChecksum=<value> 
<value>: 0 | 1 

default=0 
(Checksum is not cut off). 

 

Example 

BarcodeRemoveChecksum=1 

BarcodeShowPageNumber

Property-Name 

Data-Type 

Type 

BarcodeShowPageNumber 

String 

Set 

 

When this property is set, the page-number of the inputfile where this barcode was found is added to each output barcode from  property “BarcodeValue”. 

 

Syntax  

BarcodeShowPageNumber=<value> 
<value>: 0 | 1  

default=0 
(No output of page-number). 

 

Example 

BarcodeShowPageNumber=1 
Afterward property BarcodeValue“ contains e.g. 
BARCODE:1;DATAMATRIX;00011122233344455566677788;BARCODE:2;DATAMATRIX;899374032904908

BarcodeStopAfter

Property-Name 

Data-Type 

Type 

BarcodeStopAfter 

String 

Set 

 

For Datamatrix only. 

Defines that search is stopped after retrieving N th barcode. 

 

Syntax 

BarcodeStopAfter=<value> 
<value>: 1 to N 

default=”” 
No value set means that search continues until the end of inputfile. 

 

Example 

BarcodeStopAfter=5 

Search stops after retrieving 5th barcode.


BarcodeType

Property-Name 

Data-Type 

Type 

BarcodeType 

String 

Set 

 

This property specifies the type of barcode which is to be searched. 
 

Syntax  

BarcodeType = < onebarcodetype>  

<onebarcodetype>= "DataMatrix" | "Code128" | "Code39" | "Code39Extended" | "QR" 

default=No input, CIB ocr searches for all possible barcode-types. 

Code128 includes the subtypes: 

  • Code128A
  • Code128B
  • Code128C
  • Code128Auto

Example 

BarcodeType= DataMatrix 

BarcodeTimeout

Property-Name 

Data-Type 

Type 

BarcodeTimeout 

String 

Set 

 

For Datamatrix only. 

This property  specifies the time (in milliseconds) when CIB  ocr stops looking for more barcode-candidates in the inputfile. 

 

Syntax 

BarcodeTimeout=<value>
<value>:1 to N  

default=The whole inputfile is processed  to find all barcode-candidatesneglecting the time it takes.  

 

Example 

BarcodeTimeout=50 

BarcodeValue

Property-Name 

Data-Type 

Type 

BarcodeValue 

String 

Get 

 

This property contains a list of all barcodes found in the  input-image-file. 
BarcodeValueLength is  necessary to define the  size of the output buffer.  

 

Syntax of output: 

[BARCODE :[pagenumber;]BarcodeType;TextValue;] 

 

Example 

BARCODE:DATAMATRIX;00011122233344455566677788 

BarcodeValueLength

Property-Name 

Data-Type 

Type 

BarcodeValueLength 

String 

Get 

 

This property contains the length of the output result and thus gives the required size of output buffer.  

 

Syntax of output: 

[integer] (string representation)  

 

Example 

1000 

DatamatrixAngleDeviation

Property-Name 

Data-Type 

Type 

DatamatrixAngleDeviation 

String 

Set 

 

For Datamatrix only. 

This property gives the allowed non-squareness of corners  of rectangles in degrees (0-90). 

The size of the allowed deviation depends on the application: 

  • Faxing and flatbed scanning: A low squareness deviation (5-10 degrees is enough since all right angles in the subject image will appear as right angles in the image.
  • Scanning from a cell phone or webcam: Higher deviations (20-40 degrees) should be set as distortion due to extreme scanning angles may occur. The dmtxread utility allows large deviation values by default.

 

Syntax  

DatamatrixAngleDeviation=<value>
<value>:0 to 90 

default=10 

 

Example 

DatamatrixAngleDeviation=20 

DatamatrixShrinkingFactor

Property-Name 

Data-Type 

Type 

DatamatrixShrinkingFactor 

String 

Set 

 

For Datamatrix only. 

This property sets a factor for shrinking a high resolution image internally. 
This sometimes provides dramatic performance benefit  as the amount of pixels of a page is minimized. It especially helps when  an image has  high resolution but blurry focus.  

 

Syntax  

DatamatrixShrinkingFactor=<value>
<value>: 1 to N  

Default: 1  
(no change of original resolution) 

 

Example 

DatamatrixShrinkingFactor=2 

Means resolution is divided in half. 


DatamatrixScanGap

Property-Name 

Data-Type 

Type 

DatamatrixScanGap 

String 

Set 

 

For Datamatrix only. 

This Property allows specifying the size of the gaps in the grid pattern (using pixels). 

Increasing the gaps (e.g. to 100) can improve performance, but  if the grid is too coarse it may cause that  the barcode is no t found at all. 

 

Syntax 

DatamatrixScanGap=<value>
<value>: 1 to N 

default=1 

 

Example 

DatamatrixScanGap=50

DatamatrixThreshold

Property-Name 

Data-Type 

Type 

DatamatrixThreshold 

String 

Set 

 

For Datamatrix only. 

Lowering the threshold can increase the number of features to be scanned, but thereby slows performance. But this  may be necessary if the image is blurry or has low contrast.  
Sometimes lowering the threshold will actually improve performance if thereby a good barcode candidate  is found more quickly than otherwise. 

 

Syntax 

DatamatrixThreshold=<value>
<value>: 1 to 100  

default=5 

 

Example 

DatamatrixThreshold=10 

Weak edges below threshold 10 are ignored. 


ZBarConfig

(From CIB ocr version 2.4.0) 

 

Property-Name 

Data-Type 

Type 

ZBarConfig 

String 

Set 

 

Property for tuning of barcode recognition (ZBar functionality). 


Syntax 

ZBarConfig
        =config_
        line1[;config
        _line2[;config_line3...]] 

 

Example 

ZBarConfig=code39.enable