Class: Kreuzberg::OcrBoundingGeometryRectangle
- Inherits:
-
Data
- Object
- Data
- Kreuzberg::OcrBoundingGeometryRectangle
- Extended by:
- T::Sig
- Includes:
- OcrBoundingGeometry
- Defined in:
- lib/kreuzberg/native.rb
Overview
Axis-aligned bounding box (typical for Tesseract output).
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#left ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#top ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
-
#width ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#height ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
3618 3619 3620 |
# File 'lib/kreuzberg/native.rb', line 3618 def height @height end |
#left ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
3618 3619 3620 |
# File 'lib/kreuzberg/native.rb', line 3618 def left @left end |
#top ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
3618 3619 3620 |
# File 'lib/kreuzberg/native.rb', line 3618 def top @top end |
#width ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
3618 3619 3620 |
# File 'lib/kreuzberg/native.rb', line 3618 def width @width end |
Class Method Details
.from_hash(hash) ⇒ Object
3641 3642 3643 |
# File 'lib/kreuzberg/native.rb', line 3641 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
3637 3638 3639 |
# File 'lib/kreuzberg/native.rb', line 3637 def quadrilateral? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#rectangle? ⇒ Boolean
3635 |
# File 'lib/kreuzberg/native.rb', line 3635 def rectangle? = true |