Class: Logo::Scouts
- Inherits:
-
Object
- Object
- Logo::Scouts
- Defined in:
- lib/logo/scouts.rb
Instance Method Summary collapse
- #feature(img) ⇒ Object
-
#initialize(yml) ⇒ Scouts
constructor
A new instance of Scouts.
- #inspect(the_feature, label) ⇒ Object
- #load_suite(yml) ⇒ Object
- #release_feature(the_feature) ⇒ Object
- #show_hand(img) ⇒ Object
Constructor Details
Instance Method Details
#feature(img) ⇒ Object
12 13 14 |
# File 'lib/logo/scouts.rb', line 12 def feature(img) @recognize.image_feature(img) end |
#inspect(the_feature, label) ⇒ Object
16 17 18 |
# File 'lib/logo/scouts.rb', line 16 def inspect(the_feature, label) @recognize.match(the_feature, label) end |
#load_suite(yml) ⇒ Object
8 9 10 |
# File 'lib/logo/scouts.rb', line 8 def load_suite(yml) @suite.load(yml) end |
#release_feature(the_feature) ⇒ Object
20 21 22 |
# File 'lib/logo/scouts.rb', line 20 def release_feature(the_feature) @recognize.release_feature(the_feature) end |
#show_hand(img) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/logo/scouts.rb', line 24 def show_hand(img) the_feature = self.feature(img) scores = {} max_score = [1, ''] @data.each do |item| label = item['label'] scores[label] = inspect(the_feature, label) if scores[label] < max_score.first max_score = [scores[label], label] end end self.release_feature(the_feature) return scores, max_score end |