private final String TAG = "Gesture";
public static GestureService mService;
private AccessibilityNodeInfo mEventNode;
/**
* 是否正在滑动
*/
private boolean gesturing = false;
public static GestureService getInstance() {
return mService;
}
@Override
protected void onServiceConnected() {
super.onServiceConnected();
// Utils.toast(this, "Gesture无障碍服务已启动");
Toast.makeText(this, "Gesture无障碍服务已启动", Toast.LENGTH_SHORT).show();
Log.d(TAG, "Gesture Service Started");
mService = this;
}
生成轨迹
水果拼图, 通过元素ID找到node节点
打包apk, 安装到安卓系统中
配合OpenCV 人工智能Ai识图算法
public static double getCoordinates(String mainPic, String comPic, int b1, int b2, int f1, int f2) {
// 待匹配图片---主模板
Mat src = Imgcodecs.imread(mainPic);
// 获取匹配模板---图片模块
Mat template = Imgcodecs.imread(comPic);
// HighGui.imshow("滑块", template);
// HighGui.waitKey(0);
// HighGui.imshow("原图", src);
// HighGui.waitKey(0);
Mat backgroundEdge = findBackgroundEdge(mainPic, b1, b2);
Mat pieceContour = findPieceContour(comPic, f1, f2);