这是indexloc提供的服务,不要输入任何密码
Skip to content

能否讲一下images.matchFeatures怎么用吗?研究很多天还是不会用。 #408

@realcsnake2023

Description

@realcsnake2023

新增 images.matchFeatures/detectAndComputeFeatures 方法, 支持全分辨率找图 (Ref to Auto.js Pro)

我自以为是跟images.matchTemplate(img, template, options)的用法相似,所以写了个代码:

requestScreenCapture();
sleep(1000);
var img = images.read("/sdcard/脚本/res/JD/领水滴1.jpg");
console.log(img);
var cpt = captureScreen();
console.log(cpt);
var fndimg = images.matchFeatures(cpt,img);
console.log(fndimg);
img.recycle();

但是报错了。

方法 "images.matchFeatures" 调用失败. Argument sceneFeatures org.autojs.autojs.core.image.CapturedImage@b8dddd0 (JavaObject) for images.matchFeatures must be a ImageFeatures.
java.lang.IllegalArgumentException: Argument sceneFeatures org.autojs.autojs.core.image.CapturedImage@b8dddd0 (JavaObject) for images.matchFeatures must be a ImageFeatures
    at $remote/test1.js:7:0

请问正确的用法是什么?非常感谢!
@SuperMonster003

Metadata

Metadata

Assignees

No one assigned

    Labels

    Doubt ❔ 疑惑Any doubts about this repositoryFeedback Awaited 🕒 等待反馈Waiting for the feedback from issue creater and issue will be closed if duration is over one monthProposal 💡 方案Issue creater's own proposal which may be really helpful

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions