OS マシンの下にある 2 つのイメージを比較しようとしています。OS マシンで ImageMagick を実行しています。そして私はこの方法を使用しています:
public boolean compareImages (String expectedScreenShot, String capturedScreenShot, String pdiffCompare) {
ProcessStarter.setGlobalSearchPath("/usr/local/bin/");
CompareCmd compare = new CompareCmd();
// For metric-output
IMOperation cmpOp = new IMOperation();
// Set the compare metric
cmpOp.metric("AE");
// Add the expected image
cmpOp.addImage(expectedScreenShot);
// Add the current image
cmpOp.addImage(capturedScreenShot);
// This stores the difference
cmpOp.addImage(pdiffCompare);
try {
// Do the compare
compare.run(cmpOp);
compare.getErrorText();
return true;
}
catch (Exception ex) {
return false;
}
}
im4java:1.4.0 を使用していますが、実行すると次のcompare.run(cmpOp);
例外が発生します。
org.im4java.core.CommandException: org.im4java.core.CommandException: magick: CLI arg 1 @ error/operation.c/CLIOption/5225 で操作「-metric」のイメージが見つかりません。
どんな助けでも大歓迎です。