Class: CVFFI::FAST::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/opencv-ffi-fast/fast.rb

Constant Summary collapse

VALID_SIZES =
[ 9, 10, 11, 12 ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Params

Returns a new instance of Params.



44
45
46
47
48
49
50
# File 'lib/opencv-ffi-fast/fast.rb', line 44

def initialize( opts = {} )
  p opts
  @points = opts[:points] ||  9
  @threshold = opts[:threshold] || 20

  raise "Hm, invalid size #{@points} specified for FAST keypoint detector" unless size_valid? @points
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



36
37
38
# File 'lib/opencv-ffi-fast/fast.rb', line 36

def points
  @points
end

#thresholdObject

Returns the value of attribute threshold.



36
37
38
# File 'lib/opencv-ffi-fast/fast.rb', line 36

def threshold
  @threshold
end

Instance Method Details

#size_valid?(sz) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/opencv-ffi-fast/fast.rb', line 40

def size_valid?( sz )
  VALID_SIZES.include? sz
end

#to_hashObject



52
53
54
# File 'lib/opencv-ffi-fast/fast.rb', line 52

def to_hash
  { :points => @points, :threshold => @threshold }
end