Class: CVFFI::MatchResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(t, q, d) ⇒ MatchResult

Returns a new instance of MatchResult.



36
37
38
39
40
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 36

def initialize( t, q, d )
  @train_idx = t
  @query_idx = q
  @distance = d
end

Instance Attribute Details

#distanceObject Also known as: dist

Returns the value of attribute distance.



30
31
32
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 30

def distance
  @distance
end

#query_idxObject Also known as: qidx

Returns the value of attribute query_idx.



29
30
31
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 29

def query_idx
  @query_idx
end

#train_idxObject Also known as: tidx

Returns the value of attribute train_idx.



29
30
31
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 29

def train_idx
  @train_idx
end

Instance Method Details

#queryObject



50
51
52
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 50

def query
  @query_set[@query_idx]
end

#to_sObject



42
43
44
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 42

def to_s
  "Match t=#{@train_idx} q=#{@query_idx} distance=#{@distance}"
end

#trainObject



46
47
48
# File 'lib/opencv-ffi-wrappers/matcher.rb', line 46

def train
  @train_set[@train_idx]
end