Comments (5)
大佬有没有什么想法。难道必须不同分辨率用不同的截图去识别么
from robothelper.
😂😂有,以前我考虑过这个问题,但是一直没有去实现。
首先,截取到的图片需要做等比例缩放,缩放到你目标图片的分辨率去
其次,找点函数的返回需要改成比例位置,比如使用(0.5,0.5)这种方式去表示图片中心
from robothelper.
😂😂有,以前我考虑过这个问题,但是一直没有去实现。
首先,截取到的图片需要做等比例缩放,缩放到你目标图片的分辨率去
其次,找点函数的返回需要改成比例位置,比如使用(0.5,0.5)这种方式去表示图片中心
我试试看
from robothelper.
个人用的笨办法:
自已定义一个开发机的分辨率 比如1280*720
然后你的所有会受分辨率影响的操作全带上比例封装一下
例如点击
private void rtap(int x, int y) {
float wscale=MainActivity.w/1280;
float hscale=MainActivity.h/720;
x = (int) ((x + new Random().randomInt(-3,3))*wscale);
y = (int) ((y + new Random().randomInt(-3,3))*hscale);
Robot.tap(x,y);
}
滑动(向右)
private void rswipe(int x, int y) {
float wscale=MainActivity.w/1280;
float hscale=MainActivity.h/720;
x = (int) ((x + new Random().randomInt(-3,3))*wscale);
int x1 = (int) ((x-448)*wscale);
y = (int) ((y + new Random().randomInt(-3,3))*hscale);
int y1 = (int) (y*hscale);
int t = new Random().randomInt(1000,1500);
swipe(x,y,x1,y1,t);
}
还有取色判断之类内置的功能也加上分辨率封装一下
肯定有更好的办法,我这就是凑合着用
from robothelper.
airtest的很多图片匹配识别算法可以参考下。有好几种算法实现。建议添加python脚本支持。
from robothelper.
Related Issues (20)
- opencv 安装问题 HOT 1
- 图片匹配报错 HOT 5
- 图片模板匹配 HOT 8
- 尝试使用回收的位图错误如何解决? HOT 5
- 请问一下一些脚本的功能 HOT 1
- 交流 HOT 1
- 二值化找图 HOT 12
- 我见你的博客里面提到 不使用opencv,自己用Java实现模板匹配,后来怎么又安装opencv模块了 HOT 1
- e7root HOT 2
- 这个框架还可以正常运行吗? HOT 1
- 取色工具 HOT 5
- 可以适配安卓11吗? HOT 1
- 没连接usb进行模拟点击会导致手机卡主 HOT 2
- 雷电模拟器中不定时闪退 HOT 8
- root模式下,点击次数的限制 HOT 3
- getScreenCapHorizontal 中的 bitmapCacheVertical.isRecycled() 错误 HOT 3
- 不会配置环境 HOT 1
- input往输入框输入文字留的有接口,有计划实现吗 HOT 6
- 截图有些文字颜色有问题 HOT 3
- 大佬的网站打不开了 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robothelper.