Class: Kreuzberg::OcrBoundingGeometryRectangle

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#heightObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4134
4135
4136
# File 'lib/kreuzberg/native.rb', line 4134

def height
  @height
end

#leftObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4134
4135
4136
# File 'lib/kreuzberg/native.rb', line 4134

def left
  @left
end

#topObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4134
4135
4136
# File 'lib/kreuzberg/native.rb', line 4134

def top
  @top
end

#widthObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4134
4135
4136
# File 'lib/kreuzberg/native.rb', line 4134

def width
  @width
end

Class Method Details

.from_hash(hash) ⇒ Object



4163
4164
4165
# File 'lib/kreuzberg/native.rb', line 4163

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

Returns:

  • (Boolean)


4158
# File 'lib/kreuzberg/native.rb', line 4158

def quadrilateral? = false

#rectangle?Boolean

Returns:

  • (Boolean)


4155
# File 'lib/kreuzberg/native.rb', line 4155

def rectangle? = true