Class: CVFFI::OpenSURF::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kp) ⇒ Result

Returns a new instance of Result.



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

def initialize( kp )
   @kp = CVFFI::OpenSURF::OpenSURFPoint.new(kp)
end

Instance Attribute Details

#kpObject

Returns the value of attribute kp.



39
40
41
# File 'lib/opencv-ffi-ext/opensurf.rb', line 39

def kp
  @kp
end

Instance Method Details

#descriptorObject



51
# File 'lib/opencv-ffi-ext/opensurf.rb', line 51

def descriptor; @kp.descriptor; end

#distance_to(b) ⇒ Object



53
54
55
# File 'lib/opencv-ffi-ext/opensurf.rb', line 53

def distance_to(b)
  CVFFI::VectorMath::L2distance( @kp.descriptor, b.descriptor, 64 )
end

#laplacianObject



49
# File 'lib/opencv-ffi-ext/opensurf.rb', line 49

def laplacian; @kp.laplacian; end

#orientationObject



50
# File 'lib/opencv-ffi-ext/opensurf.rb', line 50

def orientation; @kp.orientation; end

#packed_descriptorObject



65
66
67
# File 'lib/opencv-ffi-ext/opensurf.rb', line 65

def packed_descriptor
  [@kp.descriptor.to_a.pack('e64')].pack('m0')
end

#ptObject



44
# File 'lib/opencv-ffi-ext/opensurf.rb', line 44

def pt; @kp.pt; end

#scaleObject



48
# File 'lib/opencv-ffi-ext/opensurf.rb', line 48

def scale; @kp.scale; end

#to_PointObject



61
62
63
# File 'lib/opencv-ffi-ext/opensurf.rb', line 61

def to_Point
  pt.to_Point
end

#to_vectorObject



57
58
59
# File 'lib/opencv-ffi-ext/opensurf.rb', line 57

def to_vector
  Vector.[]( x, y, 1 )
end

#xObject



45
# File 'lib/opencv-ffi-ext/opensurf.rb', line 45

def x;  pt.x; end

#yObject



46
# File 'lib/opencv-ffi-ext/opensurf.rb', line 46

def y;  pt.y; end