---
title: TBR-Targeted Barcode Reader
slug: tbr-targeted-barcode-reader
docTags: 
createdAt: 2023-03-19T17:28:33.000Z
---

Inlite’s **Targeted Barcode Reader (TBR)** delivers the highest recognition rate and/or speed for customer-specific sets of images.  In addition to several of-the-shelf specialized algorithms,  Inlite can rapidly and cost-effectively address unique customers' barcode recognition requirements.&#x20;

## TBR Code

**TBR Code** identifies an algorithm to read barcodes on a page. &#x20;

:::hint{type="info"}
Use of TBR Code is **optional.**  The **default algorithm,&#x20;**&#x69;f the TBR Code is not se&#x74;**,&#x20;**&#x20;reads most of the real-life barcodes.  &#x20;
:::

**TBR Code** – is a numeric value that identifies the TBR reader. The codes are:

- 0 – Default code. If set, it forces the use of the default algorithm.
- 100-199 – Internally predefined codes (some of the codes are reserved for future use)
- 400-499 – [External TBR Codes](./#external-tbr-codes) defined in <font color="#eb144c">`ci.ini`</font> file

## Identify the best TBR codes

To identify the best TBR codes for **your set of images**, use these tools and methods:

- Use the [TBR Wizard](docId\:huKxFlT72yExRGuc7PibN) application to find the best TBR code(s) for **single or multiple images**.
- Use the **TBR Wizard** dialog box in the  [ClearImage Demo](docId\:TeBD8glTQ2jaZlp45b7Bf) application to find the best TBR code fo&#x72;**&#x20;a single image.**
- Contact **support\@inliteresearch.com**

## Activate TBR Code

### ClearImage SDK

Set <font color="#eb144c">`TbrCode`</font> property of the readers. For example:

:::CodeblockTabs
```csharp
reader.TbrCode=103;    //  Apply TBR code 103 to Read() calls that follow
reader.Read(fileName, page);
```

```cpp
reader->TbrCode = 103;   //  Apply TBR code 103 to Find() calls that follow
reader->Find(0);
```

```java
reader.setTbrCode(103); //  Apply TBR code 103 to Find() calls that follow
reader.Find(0);
```

```php
$reader->TbrCode = 103;    //  Apply TBR code 103 to Find() calls that follow
$BCcount = $reader->Find(0);
```
:::

To use multiple TBR codes, use one of these methods:

- Repeat reading operations with each TBR code
- Use [external TBR](./#external-tbr-codes)

Notes:

- If the TBR code is invalid or not applicable to the barcode type, an exception is generated.
- If a barcode is obtained using a TBR reader, then the <font color="#eb144c">`<tbr>`</font> tag of the barcode’s meta-data contains the TBR code.
- Do not use image pre-processing with ClearImage Tools or Repair before using ClearImage Reader with TBR code. This might lead to unpredictable results.

### Barcode Reader CLI

Set <font color="#eb144c">`-tbr`</font> option value.  Multiple TBR codes are set as a comma-separated list. For example:

:::BlockQuote
-tbr=109,107
:::

## External TBR Codes

External TBR Codes are defined in the <font color="#eb144c">`[TBR]`</font> section of <font color="#eb144c">`C:\ProgramData\Inlite\ClearImage\ci.ini`</font> file. If this file does not exist, create it in any text editor (e.g., Notepad)
With external TBR, users can:

- Change the default recognition algorithm (TBR 0) to a predefined or an external TBR code without your application code change.
- Activate multiple TBR codes for a single-read operation.
- Implement new custom TBR provided by Inlite's support.

### Format

The format of the External TBR definition:

:::BlockQuote
tbr<font color="#eb144c">*CODE*</font>\[:<font color="#eb144c">*READER*</font>]=<font color="#eb144c">*COMMAND*</font>\[\~*COMMAND*]...&#x20;
:::

The values in **\[ ]** are optional. The values in *italic* are variables. Where:

| **Section**                            | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **<font color="#eb144c">`CODE`</font>  | 0 or a 3-digit TBR code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <font color="#eb144c">`READER`</font>  | Optionally, limit the type of ClearImage Readers to which <font color="#eb144c">`code`</font> is applied.<br /><font color="#eb144c">`1`</font> – Barcode 1d PRO,<br /><font color="#eb144c">`p`</font> – PDF417,<br /><font color="#eb144c">`d`</font> – DataMatrix,<br /><font color="#eb144c">`q`</font> – QR.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <font color="#eb144c">`COMMAND`</font> | Commands executed by TBR code. A tilde character (\~) should separate multiple commands. Public commands are:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|                                        | <font color="#eb144c">`id:text`</font>*&#x20; -&#x20;*&#x74;he text value is for reference purposes only and does not affect the execution<br /><font color="#eb144c">`tbr:code`</font>*&#x20;-&#x20;*&#x65;xecute TBR identified by the *code* value.<br /><font color="#eb144c">`max:nmb`</font>*&#x20;-  t*he maximum number of barcodes to read. If both <font color="#eb144c">`max:nmb`</font> and <font color="#eb144c">`MaxBarcodes`</font> in <font color="#eb144c">`Find(MaxBarcodes)`</font> or <font color="#eb144c">`BarcodeReader.MaxBarcodes`</font> are non-zero, then the minimum value applies.<br /><font color="#eb144c">`rd`</font> -  read barcodes after applying commands that follow the last <font color="#eb144c">`rd`</font> command. For the first <font color="#eb144c">`rd`</font> command, all commands from the start are applied. |



Put <font color="#eb144c">`[TBR]`</font>  section header before any external TBR definition in <font color="#eb144c">`C:\ProgramData\Inlite\ClearImage\ci.ini`</font> file. For example:

:::BlockQuote
\[TBR]
tbr0\:p=tbr:103
tbr410=max:1\~tbr:112\~rd\~tbr:125\~rd\~tbr:103\~rd
:::

### Example:  Override default processing

This example changes default processing to TBR 103 for PDF417 reader only

:::BlockQuote
<font color="#eb144c">tbr**0**:**p**=tbr:103</font> 
:::

This method changes barcode reader behavior without a change of your application code.

### Example: Chain several TBR codes

This example reads **one** barcode using TBR codes 112, 125, and 103. Once the barcode is found (e.g., with code 112), further processing is stopped.   Activate TBR Code **410&#x20;**&#x69;n your code.

:::BlockQuote
<font color="#eb144c">tbr**410**=max:1~tbr:112~rd~tbr:125~rd~tbr:103~rd</font>
:::

To the same sequence without changing this code, assign this sequence to the default TBR code **0**.  &#x20;

:::BlockQuote
<font color="#eb144c">tbr**0**=max:1~tbr:112~rd~tbr:125~rd~tbr:103~rd</font>
:::

### Example:  Custom TBR codes

Using external TBR, Inlite can quickly deliver an algorithm tailored for processing your specific images.
An example of such activation is:

:::BlockQuote
<font color="#eb144c">tbr**411**=id:***Acme.2023-04***:**nxD96psyGAJXsfkmUc..PCArZlQgA**</font>
:::

Where&#x20;

- &#x20;<font color="#eb144c">`411`</font>is a TBR code
- <font color="#eb144c">`Acme.2023-04`</font> - is a reference id, typically used for identifying customer and algorithm
- <font color="#eb144c">`nxD96ps...`</font> - is an encrypted algorithm developed for a customer by Inlite






