Class: Kreuzberg::OcrBoundingGeometryQuadrilateral

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
OcrBoundingGeometry
Defined in:
lib/kreuzberg/native.rb

Overview

4-point quadrilateral for rotated/skewed text (PaddleOCR).

Points are in clockwise order starting from top-left: ‘[top_left, top_right, bottom_right, bottom_left]`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointsObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



3184
3185
3186
# File 'lib/kreuzberg/native.rb', line 3184

def points
  @points
end

Class Method Details

.from_hash(hash) ⇒ Object



3198
3199
3200
# File 'lib/kreuzberg/native.rb', line 3198

def self.from_hash(hash)
  new(points: hash[:points] || hash["points"])
end

Instance Method Details

#quadrilateral?Boolean

Returns:

  • (Boolean)


3194
3195
3196
# File 'lib/kreuzberg/native.rb', line 3194

def quadrilateral? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]

#rectangle?Boolean

Returns:

  • (Boolean)


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

def rectangle? = false