Class: Xberg::OcrBoundingGeometryQuadrilateral

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
OcrBoundingGeometry
Defined in:
lib/xberg/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



3835
3836
3837
# File 'lib/xberg/native.rb', line 3835

def points
  @points
end

Class Method Details

.from_hash(hash) ⇒ Object



3850
3851
3852
# File 'lib/xberg/native.rb', line 3850

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

Instance Method Details

#quadrilateral?Boolean

Returns:

  • (Boolean)


3846
3847
3848
# File 'lib/xberg/native.rb', line 3846

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

#rectangle?Boolean

Returns:

  • (Boolean)


3844
# File 'lib/xberg/native.rb', line 3844

def rectangle? = false