Class: Xberg::OcrBoundingGeometryRectangle
- Inherits:
-
Data
- Object
- Data
- Xberg::OcrBoundingGeometryRectangle
- Extended by:
- T::Sig
- Includes:
- OcrBoundingGeometry
- Defined in:
- lib/xberg/native.rb
Overview
Axis-aligned bounding box (typical for Tesseract output).
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height
4538 4539 4540 |
# File 'lib/xberg/native.rb', line 4538 def height @height end |
#left ⇒ Object (readonly)
Returns the value of attribute left
4538 4539 4540 |
# File 'lib/xberg/native.rb', line 4538 def left @left end |
#top ⇒ Object (readonly)
Returns the value of attribute top
4538 4539 4540 |
# File 'lib/xberg/native.rb', line 4538 def top @top end |
#width ⇒ Object (readonly)
Returns the value of attribute width
4538 4539 4540 |
# File 'lib/xberg/native.rb', line 4538 def width @width end |
Class Method Details
.from_hash(hash) ⇒ Object
4561 4562 4563 4564 4565 4566 4567 4568 |
# File 'lib/xberg/native.rb', line 4561 def self.from_hash(hash) new( left: hash[:left] || hash["left"], top: hash[:top] || hash["top"], width: hash[:width] || hash["width"], height: hash[:height] || hash["height"] ) end |
Instance Method Details
#quadrilateral? ⇒ Boolean
4557 4558 4559 |
# File 'lib/xberg/native.rb', line 4557 def quadrilateral? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#rectangle? ⇒ Boolean
4555 |
# File 'lib/xberg/native.rb', line 4555 def rectangle? = true |