Class: Google::Cloud::Vision::V1::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb

Overview

Logical element on the page.

Defined Under Namespace

Modules: BlockType

Instance Attribute Summary collapse

Instance Attribute Details

#block_typeGoogle::Cloud::Vision::V1::Block::BlockType

Returns Detected block type (text, image etc) for this block.

Returns:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb', line 140

class Block
  # Type of a block (text, image etc) as identified by OCR.
  module BlockType
    # Unknown block type.
    UNKNOWN = 0

    # Regular text block.
    TEXT = 1

    # Table block.
    TABLE = 2

    # Image block.
    PICTURE = 3

    # Horizontal/vertical line box.
    RULER = 4

    # Barcode block.
    BARCODE = 5
  end
end

#bounding_boxGoogle::Cloud::Vision::V1::BoundingPoly

Returns The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like:

0----1 | | 3----2

  • when it's rotated 180 degrees around the top-left corner it becomes:

2----3 | | 1----0

and the vertice order will still be (0, 1, 2, 3).

Returns:

  • (Google::Cloud::Vision::V1::BoundingPoly)

    The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

    • when the text is horizontal it might look like:

    0----1 | | 3----2

    • when it's rotated 180 degrees around the top-left corner it becomes:

    2----3 | | 1----0

    and the vertice order will still be (0, 1, 2, 3).



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb', line 140

class Block
  # Type of a block (text, image etc) as identified by OCR.
  module BlockType
    # Unknown block type.
    UNKNOWN = 0

    # Regular text block.
    TEXT = 1

    # Table block.
    TABLE = 2

    # Image block.
    PICTURE = 3

    # Horizontal/vertical line box.
    RULER = 4

    # Barcode block.
    BARCODE = 5
  end
end

#confidenceFloat

Returns Confidence of the OCR results on the block. Range [0, 1].

Returns:

  • (Float)

    Confidence of the OCR results on the block. Range [0, 1].



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb', line 140

class Block
  # Type of a block (text, image etc) as identified by OCR.
  module BlockType
    # Unknown block type.
    UNKNOWN = 0

    # Regular text block.
    TEXT = 1

    # Table block.
    TABLE = 2

    # Image block.
    PICTURE = 3

    # Horizontal/vertical line box.
    RULER = 4

    # Barcode block.
    BARCODE = 5
  end
end

#paragraphsArray<Google::Cloud::Vision::V1::Paragraph>

Returns List of paragraphs in this block (if this blocks is of type text).

Returns:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb', line 140

class Block
  # Type of a block (text, image etc) as identified by OCR.
  module BlockType
    # Unknown block type.
    UNKNOWN = 0

    # Regular text block.
    TEXT = 1

    # Table block.
    TABLE = 2

    # Image block.
    PICTURE = 3

    # Horizontal/vertical line box.
    RULER = 4

    # Barcode block.
    BARCODE = 5
  end
end

#propertyGoogle::Cloud::Vision::V1::TextAnnotation::TextProperty

Returns Additional information detected for the block.

Returns:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/cloud/vision/v1/doc/google/cloud/vision/v1/text_annotation.rb', line 140

class Block
  # Type of a block (text, image etc) as identified by OCR.
  module BlockType
    # Unknown block type.
    UNKNOWN = 0

    # Regular text block.
    TEXT = 1

    # Table block.
    TABLE = 2

    # Image block.
    PICTURE = 3

    # Horizontal/vertical line box.
    RULER = 4

    # Barcode block.
    BARCODE = 5
  end
end