Vision OCR API, gRPC: TextRecognitionService
Статья создана
Обновлена 3 октября 2024 г.
A set of methods for the Vision OCR service.
Call | Description |
---|---|
Recognize | To send the image for text recognition. |
Calls TextRecognitionService
Recognize
To send the image for text recognition.
rpc Recognize (RecognizeTextRequest) returns (stream RecognizeTextResponse)
RecognizeTextRequest
Field | Description |
---|---|
source | oneof: content |
content | bytes Bytes with data |
mime_type | string Specifications of the (MIME type
|
language_codes[] | string List of the languages to recognize text. Specified in ISO 639-1 ru ). |
model | string Model to use for text detection. The maximum string length in characters is 50. |
RecognizeTextResponse
Field | Description |
---|---|
text_annotation | TextAnnotation Recognized text blocks in page or text from entities. |
page | int64 Page number in PDF file. |
TextAnnotation
Field | Description |
---|---|
width | int64 Page width in pixels. |
height | int64 Page height in pixels. |
blocks[] | Block Recognized text blocks in this page. |
entities[] | Entity Recognized entities. |
tables[] | Table |
full_text | string Full text recognized from image. |
rotate | enum Angle Angle of image rotation. |
Block
Field | Description |
---|---|
bounding_box | Polygon Area on the page where the text block is located. |
lines[] | Line Recognized lines in this block. |
languages[] | DetectedLanguage A list of detected languages |
text_segments[] | TextSegments Block position from full_text string. |
DetectedLanguage
Field | Description |
---|---|
language_code | string Detected language code. |
Polygon
Field | Description |
---|---|
vertices[] | Vertex The bounding polygon vertices. |
Vertex
Field | Description |
---|---|
x | int64 X coordinate in pixels. |
y | int64 Y coordinate in pixels. |
Line
Field | Description |
---|---|
bounding_box | Polygon Area on the page where the line is located. |
text | string Recognized text. |
words[] | Word Recognized words. |
text_segments[] | TextSegments Line position from full_text string. |
orientation | enum Angle Angle of line rotation. |
Word
Field | Description |
---|---|
bounding_box | Polygon Area on the page where the word is located. |
text | string Recognized word value. |
entity_index | int64 ID of the recognized word in entities array. |
text_segments[] | TextSegments Word position from full_text string. |
TextSegments
Field | Description |
---|---|
start_index | int64 Start character position from full_text string. |
length | int64 Text segment length. |
Entity
Field | Description |
---|---|
name | string Entity name. |
text | string Recognized entity text. |
Table
Field | Description |
---|---|
bounding_box | Polygon Area on the page where the table is located. |
row_count | int64 Number of rows in table. |
column_count | int64 Number of columns in table. |
cells[] | TableCell Table cells. |
TableCell
Field | Description |
---|---|
bounding_box | Polygon Area on the page where the table cell is located. |
row_index | int64 Row index. |
column_index | int64 Column index. |
column_span | int64 Column span. |
row_span | int64 Row span. |
text | string Text in cell. |
text_segments[] | TextSegments Table cell position from full_text string. |