Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve #35 and #15 #40

Merged
merged 12 commits into from
Jun 12, 2018
Merged

solve #35 and #15 #40

merged 12 commits into from
Jun 12, 2018

Conversation

eternal-flame-AD
Copy link

@eternal-flame-AD eternal-flame-AD commented Jun 4, 2018

This pull request gave an solution to issue #35 and #15
for issue #15 I added a find_y_bias function to first search for the white line underneath the "home page" button to determine where the bottom of the app is.

@wangshub
Copy link
Owner

wangshub commented Jun 5, 2018

@eternal-flame-AD

  • 代码少了 lint 检查,比如等号左右缺少空格
  • 运行会报错,图片索引超出范围

正在从 /Users/kaboom/Desktop/python/fork/Douyin-Bot/config/1920x1080/config.json 加载配置文件
程序版本号:0.0.1
激活窗口并按 CONTROL + C 组合键退出
**********
Screen: Physical size: 1080x1920
Density: Physical density: 420
Device: OnePlus5
Phone OS: 8.1.0
Host OS: darwin
Python: 3.6.4 (default, Mar  9 2018, 23:15:03)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
**********
shell screencap -p /sdcard/autojump.png
pull /sdcard/autojump.png .
采用方式 0 获取截图
shell screencap -p /sdcard/autojump.png
pull /sdcard/autojump.png .
Traceback (most recent call last):
  File "douyin-bot.py", line 210, in <module>
    main()
  File "douyin-bot.py", line 156, in main
    find_y_bias()
  File "douyin-bot.py", line 97, in find_y_bias
    while not is_line(im, config['home_sel']['x1'], config['home_sel']['x2'], y, y+1, r=255, g=255, b=255):
  File "douyin-bot.py", line 91, in is_line
    if not pixel_match(im,x,y,r,g,b,diff):
  File "douyin-bot.py", line 72, in pixel_match
    pixel=im.getpixel((target_x,target_y))
  File "/usr/local/lib/python3.6/site-packages/PIL/Image.py", line 1282, in getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

@wangshub
Copy link
Owner

wangshub commented Jun 5, 2018

@eternal-flame-AD 请遵从 pep8 规范

@eternal-flame-AD
Copy link
Author

我回去看下为啥找不到-_-#
我的手机和模拟器都找得到

@eternal-flame-AD
Copy link
Author

@wangshub 现在应该修复了

@eternal-flame-AD
Copy link
Author

抱歉之前自测的时候HEAD位置忘了回到最近了

@wangshub
Copy link
Owner

wangshub commented Jun 6, 2018

@eternal-flame-AD 我运行,在识别到人脸的时候,还是报错

@eternal-flame-AD
Copy link
Author

识别人脸那段没改呀?

@eternal-flame-AD
Copy link
Author

我在一台有虚拟按键 一台没有虚拟按键的设备上测试都可以正常运行
或者有一种可能我以前也遇到过,是不是手机上有色温滤镜(过滤蓝光)的功能改变了屏幕的颜色导致无法识别?

@wangshub
Copy link
Owner

wangshub commented Jun 6, 2018

@eternal-flame-AD 我有时间看下你的代码

@msterzhang
Copy link

@wangshub ,我觉得人脸提取那部分可以优化,可以参考我这个代码https://github.com/msterzhang/douyinAi,总的代码200行不到就OK

@eternal-flame-AD
Copy link
Author

@msterzhang This is unrelated to this specific pull request, maybe you can open a new issue or PR to propose your improvements. Thanks

@wangshub wangshub changed the base branch from master to dev June 12, 2018 15:08
@wangshub wangshub merged commit d31bf26 into wangshub:dev Jun 12, 2018
@wangshub
Copy link
Owner

我先合到 dev 分支,有问题再改 @eternal-flame-AD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants