Vincentzyx / DouZero_For_HLDDZ_FullAuto

将DouZero用于欢乐斗地主自动化
Apache License 2.0
680 stars 168 forks source link

测试分辨率报错 #6

Open ZakiuC opened 2 years ago

ZakiuC commented 2 years ago

截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') 截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。') Traceback (most recent call last): File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\debug_screenshot.py", line 7, in img = gh.DrawRectWithText(img, (313, 747, 1144, 200), "test") File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\GameHelper.py", line 29, in DrawRectWithText img = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'cvtColor'

Overload resolution failed:

  • src data type = 17 is not supported
  • Expected Ptr for argument 'src'
shuaidemeikan commented 2 years ago

用管理员身份运行

dqgod commented 2 years ago

main函数里 176行 self.Handle = win32gui.FindWindow("Hlddz", None), 需要把里面“hlddz”改成你自己运行的斗地主的代码