when run this method to compare image
method
byte [] screenshot2 = Base64. encodeBase64 ( calendar_Screen .eventlabel.getScreenshotAs(OutputType. BYTES ));
FeaturesMatchingResult result = driver
.matchImagesFeatures(screenshot, screenshot2, new FeaturesMatchingOptions()
.withDetectorName(FeatureDetector. ORB )
.withGoodMatchesFactor(40)
.withMatchFunc(MatchingFunction. BRUTE_FORCE_HAMMING )
.withEnabledVisualization());
Assert. assertEquals (result.getVisualization().length>0, true );
Assert. assertEquals (result.getCount()>0, true );
Assert. assertEquals (result.getTotalCount()>0, true );
assertFalse (result.getPoints1().isEmpty());
assertNotNull (result.getRect1());
assertFalse (result.getPoints2().isEmpty());
assertNotNull (result.getRect2());
log .info("the result is "+result);
i got this issue in log
Executing command ‘compareImages’
[debug] [Support] Initializing opencv
[debug] [Support] Loading local package ‘opencv4nodejs’
[debug] [Support] Failed to load local package ‘opencv4nodejs’: Cannot find module ‘/opt/homebrew/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs’
[debug] [Support] Require stack:
[debug] [Support] - /opt/homebrew/lib/node_modules/opencv4nodejs/lib/cv.js
[debug] [Support] - /opt/homebrew/lib/node_modules/opencv4nodejs/lib/opencv4nodejs.js
[debug] [Support] - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/node.js
[debug] [Support] - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js
[debug] [Support] - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/index.js
[debug] [Support] - /opt/homebrew/lib/node_modules/appium/build/lib/logsink.js
[debug] [Support] - /opt/homebrew/lib/node_modules/appium/build/lib/main.js
[debug] [Support] Failed to load global package ‘opencv4nodejs’: The “path” argument must be of type string. Received undefined
[debug] [Support] Linking package ‘opencv4nodejs’
[debug] [Support] Unable to load package ‘opencv4nodejs’, linking failed: Command ‘npm link opencv4nodejs’ exited with code 1
[debug] [Support] info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
[debug] [Support] info readAutoBuildFile file does not exists: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/auto-build.json /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/auto-build.json
[debug] [Support] info install failed to find auto-build.json: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/auto-build.json
[debug] [Support] info install
[debug] [Support] info install running install script…
[debug] [Support] info install
[debug] [Support] info install opencv version: 3.4.6
[debug] [Support] info install with opencv contrib: yes
[debug] [Support] info install custom build flags:
[debug] [Support] info install
[debug] [Support] info install executing: git --version
[debug] [Support] info install git --version: git version 2.30.1 (Apple Git-130)
[debug] [Support] info install
[debug] [Support] info install executing: cmake --version
[debug] [Support] ERR! Error: failed to execute cmake --version, cmake is required to build opencv, error is: Error: Command failed: cmake --version
[debug] [Support] /bin/sh: cmake: command not found
[debug] [Support]
[debug] [Support] npm ERR! code ELIFECYCLE
[debug] [Support] npm ERR! errno 1
[debug] [Support] npm ERR! [email protected] install: node ./install.js
[debug] [Support] npm ERR! Exit status 1
[debug] [Support] npm ERR!
[debug] [Support] npm ERR! Failed at the [email protected] install script.
[debug] [Support] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[debug] [Support]
[debug] [Support] npm ERR! A complete log of this run can be found in:
[debug] [35m[Support] Unable to load package ‘opencv4nodejs’: Unable[35m[Support] npm ERR! /Users/mohamedgamal/.np to load package ‘opencv4nodejs’, linking failed: Command 'm/_logs/2021-0n8-19T15_02_16_672Z-debug.log
[debug] pm link opencv4nodejs’ exited with code 1
[35m[Support]
[Support] Unable to load ‘opencv4nodejs’: Unable to load package ‘opencv4nodejs’: Unable to load package ‘opencv4nodejs’, linking failed: Command ‘npm link opencv4nodejs’ exited with code 1
[debug] [W3C (4e730ba6)] Encountered internal error running command: Error: ‘opencv4nodejs’ module is required to use OpenCV features. Please install it first (‘npm i -g opencv4nodejs’) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
[debug] [W3C (4e730ba6)] at initOpenCV (/opt/homebrew/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:110:11)
[debug] [W3C (4e730ba6)] at Object.getImagesMatches (/opt/homebrew/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:248:3)
[debug] [W3C (4e730ba6)] at XCUITestDriver.compareImages (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/images.js:55:16)
**although i installed OpenCV **
and when run appium-doccotor >> no issue appeared