Class: CVFFI::STAR::ResultsArray
- Inherits:
-
Object
- Object
- CVFFI::STAR::ResultsArray
- Includes:
- Enumerable
- Defined in:
- lib/opencv-ffi-wrappers/features2d/star.rb
Instance Attribute Summary collapse
-
#kp ⇒ Object
Returns the value of attribute kp.
Instance Method Summary collapse
- #[](i) ⇒ Object
- #each ⇒ Object
-
#initialize(kp) ⇒ ResultsArray
constructor
A new instance of ResultsArray.
- #mark_on_image(img, opts) ⇒ Object
- #result(i) ⇒ Object
- #size ⇒ Object (also: #length)
Methods included from Enumerable
Constructor Details
#initialize(kp) ⇒ ResultsArray
Returns a new instance of ResultsArray.
41 42 43 44 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 41 def initialize( kp ) @kp = Sequence.new(kp) @results = Array.new( @kp.length ) end |
Instance Attribute Details
#kp ⇒ Object
Returns the value of attribute kp.
39 40 41 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 39 def kp @kp end |
Instance Method Details
#[](i) ⇒ Object
56 57 58 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 56 def [](i) result(i) end |
#each ⇒ Object
50 51 52 53 54 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 50 def each @results.each_index { |i| yield result(i) } end |
#mark_on_image(img, opts) ⇒ Object
65 66 67 68 69 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 65 def mark_on_image( img, opts ) each { |r| CVFFI::draw_circle( img, r.kp.pt, opts ) } end |
#result(i) ⇒ Object
46 47 48 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 46 def result(i) @results[i] ||= Result.new( @kp[i] ) end |
#size ⇒ Object Also known as: length
60 61 62 |
# File 'lib/opencv-ffi-wrappers/features2d/star.rb', line 60 def size @kp.size end |