Class: CVFFI::SURF::Result
- Inherits:
-
Object
- Object
- CVFFI::SURF::Result
- Defined in:
- lib/opencv-ffi-wrappers/features2d/surf.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#kp ⇒ Object
Returns the value of attribute kp.
Instance Method Summary collapse
- #distance_to(q) ⇒ Object
-
#initialize(kp, desc) ⇒ Result
constructor
A new instance of Result.
- #pt ⇒ Object
- #to_Point ⇒ Object
- #to_vector ⇒ Object
- #x ⇒ Object
- #y ⇒ Object
Constructor Details
#initialize(kp, desc) ⇒ Result
Returns a new instance of Result.
17 18 19 20 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 17 def initialize( kp, desc ) @kp = CVFFI::CvSURFPoint.new(kp) @desc = desc end |
Instance Attribute Details
#desc ⇒ Object
Returns the value of attribute desc.
16 17 18 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 16 def desc @desc end |
#kp ⇒ Object
Returns the value of attribute kp.
16 17 18 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 16 def kp @kp end |
Instance Method Details
#distance_to(q) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 26 def distance_to( q ) # Here's the pure-Ruby way to do it # @desc.inject_with_index(0.0) { |x,d,i| x + (d-q.desc.d[i])**2 } CVFFI::VectorMath::L2distance( @desc, q.desc ) end |
#pt ⇒ Object
22 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 22 def pt; @kp.pt; end |
#to_Point ⇒ Object
37 38 39 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 37 def to_Point pt.to_Point end |
#to_vector ⇒ Object
33 34 35 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 33 def to_vector Vector.[]( x, y, 1 ) end |
#x ⇒ Object
23 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 23 def x; pt.x; end |
#y ⇒ Object
24 |
# File 'lib/opencv-ffi-wrappers/features2d/surf.rb', line 24 def y; pt.y; end |