Class: CVFFI::FAST::Params
- Inherits:
-
Object
- Object
- CVFFI::FAST::Params
- Defined in:
- lib/opencv-ffi-fast/fast.rb
Constant Summary collapse
- VALID_SIZES =
[ 9, 10, 11, 12 ]
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Params
constructor
A new instance of Params.
- #size_valid?(sz) ⇒ Boolean
- #to_hash ⇒ Object
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
#points ⇒ Object
Returns the value of attribute points.
36 37 38 |
# File 'lib/opencv-ffi-fast/fast.rb', line 36 def points @points end |
#threshold ⇒ Object
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
40 41 42 |
# File 'lib/opencv-ffi-fast/fast.rb', line 40 def size_valid?( sz ) VALID_SIZES.include? sz end |
#to_hash ⇒ Object
52 53 54 |
# File 'lib/opencv-ffi-fast/fast.rb', line 52 def to_hash { :points => @points, :threshold => @threshold } end |