Class: Azure::CognitiveServices::ComputerVision::V2_0::Models::OcrResult

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#languageString

Returns The BCP-47 language code of the text in the image.

Returns:

  • (String)

    The BCP-47 language code of the text in the image.



17
18
19
# File 'lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb', line 17

def language
  @language
end

#orientationString

value (up, down, left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property).

Returns:

  • (String)

    Orientation of the text recognized in the image. The



36
37
38
# File 'lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb', line 36

def orientation
  @orientation
end

#regionsArray<OcrRegion>

represents a region of recognized text.

Returns:

  • (Array<OcrRegion>)

    An array of objects, where each object



40
41
42
# File 'lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb', line 40

def regions
  @regions
end

#text_angleFloat

respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly.

Returns:

  • (Float)

    The angle, in degrees, of the detected text with



29
30
31
# File 'lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb', line 29

def text_angle
  @text_angle
end

Class Method Details

.mapperObject

Mapper for OcrResult class as Ruby Hash. This will be used for serialization/deserialization.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/2.0/generated/azure_cognitiveservices_computervision/models/ocr_result.rb', line 47

def self.mapper()
  {
    client_side_validation: true,
    required: false,
    serialized_name: 'OcrResult',
    type: {
      name: 'Composite',
      class_name: 'OcrResult',
      model_properties: {
        language: {
          client_side_validation: true,
          required: false,
          serialized_name: 'language',
          type: {
            name: 'String'
          }
        },
        text_angle: {
          client_side_validation: true,
          required: false,
          serialized_name: 'textAngle',
          type: {
            name: 'Double'
          }
        },
        orientation: {
          client_side_validation: true,
          required: false,
          serialized_name: 'orientation',
          type: {
            name: 'String'
          }
        },
        regions: {
          client_side_validation: true,
          required: false,
          serialized_name: 'regions',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'OcrRegionElementType',
                type: {
                  name: 'Composite',
                  class_name: 'OcrRegion'
                }
            }
          }
        }
      }
    }
  }
end