Method: Appium::Core::Base::Device::ImageComparison#match_images_features
- Defined in:
- lib/appium_lib_core/common/device/image_comparison.rb
#match_images_features(first_image:, second_image:, detector_name: 'ORB', match_func: 'BruteForce', good_matches_factor: nil, visualize: false) ⇒ Object
Performs images matching by features with default options. Read py_matcher for more details on this topic.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/appium_lib_core/common/device/image_comparison.rb', line 61 def match_images_features(first_image:, second_image:, detector_name: 'ORB', match_func: 'BruteForce', good_matches_factor: nil, visualize: false) unless MATCH_FEATURES[:detector_name].member?(detector_name.to_s) raise ::Appium::Core::Error::ArgumentError, "detector_name should be #{MATCH_FEATURES[:detector_name]}" end unless MATCH_FEATURES[:match_func].member?(match_func.to_s) raise ::Appium::Core::Error::ArgumentError, "match_func should be #{MATCH_FEATURES[:match_func]}" end unless MATCH_FEATURES[:visualize].member?(visualize) raise ::Appium::Core::Error::ArgumentError, "visualize should be #{MATCH_FEATURES[:visualize]}" end = {} [:detectorName] = detector_name.to_s.upcase [:matchFunc] = match_func.to_s [:goodMatchesFactor] = good_matches_factor.to_i unless good_matches_factor.nil? [:visualize] = visualize compare_images(mode: :matchFeatures, first_image: first_image, second_image: second_image, options: ) end |