# OCRBlock

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OCRBlock/

Struct for describing an OCR block.

- **Full name:** `MFiles.OCRBlock`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-id"></a>`id` | `int32` | 1 | Unique ID (within a vault). |
| <a id="f-name"></a>`name` | `string` | 2 | Human-friendly name of the block. |
| <a id="f-page"></a>`page` | `uint32` | 3 | One-based number of page on which this block should appear. 0 can be used to indicate the first recognizable instance. |
| <a id="f-dimension_unit"></a>`dimension_unit` | [`OCRBlockDimUnitType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.OCRBlockDimUnitType/index.md) | 4 | Defines the unit of the block rectangle dimensions. Default is pixels. Values: `OCRBLOCK_DIM_UNIT_TYPE_PIXELS` (0), `OCRBLOCK_DIM_UNIT_TYPE_MILLIMETERS_X10` (1), `OCRBLOCK_DIM_UNIT_TYPE_INCHES_X100` (2). |
| <a id="f-left"></a>`left` | `uint32` | 5 | Distance from the left of the image. |
| <a id="f-top"></a>`top` | `uint32` | 6 | Distance from the top of the image. |
| <a id="f-width"></a>`width` | `uint32` | 7 | Width of the block rectangle. |
| <a id="f-height"></a>`height` | `uint32` | 8 | Height of the block rectangle. |
| <a id="f-options"></a>`options` | [`OCROptions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OCROptions/index.md) | 9 | OCR options used for this block. If unset, default settings are used. |
| <a id="f-confidence_threshold"></a>`confidence_threshold` | `int32` | 10 | Max confidence level that is acceptable for reognition. No threshold if -1. |
| <a id="f-filter_regular_expression"></a>`filter_regular_expression` | `string` | 11 | Regular expression for value confirmation (not used if length is 0). |
| <a id="f-remove_line_breaks"></a>`remove_line_breaks` | `bool` | 12 | Indicates whether recognized value lines should be collapsed into a one-line value. Default is true. |
| <a id="f-is_barcode"></a>`is_barcode` | `bool` | 13 | True if the block should be interpreted as barcode. |
| <a id="f-data_type"></a>`data_type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | 14 | Data type for the result. |

<a id="used-in-fields"></a>

## Used in fields

- [`DefaultPropertyUnion.FromOcrData.block`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DefaultPropertyUnion/index.md#t-FromOcrData-block): OCR Block definition.
- [`OCRPage.blocks`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.OCRPage/index.md#f-blocks): An array of OCR blocks.
