Class: Google::Apis::VisionV1::Page

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/vision_v1/classes.rb,
lib/google/apis/vision_v1/representations.rb,
lib/google/apis/vision_v1/representations.rb

Overview

Detected page from OCR.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Page

Returns a new instance of Page.



9329
9330
9331
# File 'lib/google/apis/vision_v1/classes.rb', line 9329

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#blocksArray<Google::Apis::VisionV1::Block>

List of blocks of text, images etc on this page. Corresponds to the JSON property blocks

Returns:



9305
9306
9307
# File 'lib/google/apis/vision_v1/classes.rb', line 9305

def blocks
  @blocks
end

#confidenceFloat

Confidence of the OCR results on the page. Range [0, 1]. Corresponds to the JSON property confidence

Returns:

  • (Float)


9310
9311
9312
# File 'lib/google/apis/vision_v1/classes.rb', line 9310

def confidence
  @confidence
end

#heightFixnum

Page height. For PDFs the unit is points. For images (including TIFFs) the unit is pixels. Corresponds to the JSON property height

Returns:

  • (Fixnum)


9316
9317
9318
# File 'lib/google/apis/vision_v1/classes.rb', line 9316

def height
  @height
end

#propertyGoogle::Apis::VisionV1::TextProperty

Additional information detected on the structural component. Corresponds to the JSON property property



9321
9322
9323
# File 'lib/google/apis/vision_v1/classes.rb', line 9321

def property
  @property
end

#widthFixnum

Page width. For PDFs the unit is points. For images (including TIFFs) the unit is pixels. Corresponds to the JSON property width

Returns:

  • (Fixnum)


9327
9328
9329
# File 'lib/google/apis/vision_v1/classes.rb', line 9327

def width
  @width
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9334
9335
9336
9337
9338
9339
9340
# File 'lib/google/apis/vision_v1/classes.rb', line 9334

def update!(**args)
  @blocks = args[:blocks] if args.key?(:blocks)
  @confidence = args[:confidence] if args.key?(:confidence)
  @height = args[:height] if args.key?(:height)
  @property = args[:property] if args.key?(:property)
  @width = args[:width] if args.key?(:width)
end