Meowcolm024 / FGO-Automata

一个FGO脚本和API フェイトグランドオーダー自動化
https://meowcolm024.github.io/FGO-Automata/
MIT License
120 stars 34 forks source link

选择地图后选人报错 #32

Closed hbw0018 closed 3 years ago

hbw0018 commented 3 years ago

Traceback (most recent call last): File "ceshi.py", line 4, in fgo.quick_start(advance=True) File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 433, in quick_start self.select_checkpoint() File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 221, in select_checkpoint if util.standby(self.aquire_screenshot(), crds.IMAGE["no_ap"]): File "C:\youxi\FGO-Automata-dev\core\util.py", line 58, in standby res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr' 您好,下了新的仓库,选择地图后进入选助战界面报错了

hbw0018 commented 3 years ago

不是,确认地图后,进入助战选择界面就报错了

Meowcolm024 commented 3 years ago

看看有没有截到图

Meowcolm024 commented 3 years ago

我又把东西改回去了,看看行不行(要注意模板图片的路径

hbw0018 commented 3 years ago

没有进入截图

Meowcolm024 commented 3 years ago

没有进入截图

助战图片放在哪里了? (更新的时候我把资源目录结构修改了一下)

hbw0018 commented 3 years ago

跟以前一样 我直接复制的我的图

Meowcolm024 commented 3 years ago

跟以前一样 我直接复制的我的图

就是在哪个文件夹?要和crds.py里面的对应。

hbw0018 commented 3 years ago

assets文件夹

Meowcolm024 commented 3 years ago

assets文件夹

那就是图片路径不对。

要不放到assets/cn下面

要不放到assets/jp下面,然后修改crds.py里面:

IMAGE_BASE = "assets/jp/"
hbw0018 commented 3 years ago

error: protocol fault (couldn't read status): Connection reset by peer adb: error: failed to get feature set: protocol fault (couldn't read status): Connection reset by peer Traceback (most recent call last): File "ceshi.py", line 4, in fgo.quick_start(advance=True) File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 433, in quick_start self.select_checkpoint() File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 212, in select_checkpoint self.wait(self.checkpoint) File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 481, in wait while not util.standby(self.aquire_screenshot(), pic): File "C:\youxi\FGO-Automata-dev\core\util.py", line 58, in standby res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'

第1次运行完成 请按任意键继续. . .

修改完路径 连地图都不进了 直接报错了

Meowcolm024 commented 3 years ago

error: protocol fault (couldn't read status): Connection reset by peer adb: error: failed to get feature set: protocol fault (couldn't read status): Connection reset by peer Traceback (most recent call last): File "ceshi.py", line 4, in fgo.quick_start(advance=True) File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 433, in quick_start self.select_checkpoint() File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 212, in select_checkpoint self.wait(self.checkpoint) File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 481, in wait while not util.standby(self.aquire_screenshot(), pic): File "C:\youxi\FGO-Automata-dev\core\util.py", line 58, in standby res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'

第1次运行完成 请按任意键继续. . .

修改完路径 连地图都不进了 直接报错了

图片路径要和图片位置匹配啊! 用于识别的模板图片和关卡/助战的路径是分开的。

下面举个例子:

假如所有除助战/关卡的图片都放到了assets/jp里面,crds.py就应该修改:

IMAGE_BASE = "assets/jp/"

而你的助战/关卡图片如果放到了assets里面,脚本文件就应该是:

fgo = Automata("assets/checkpoint.png", "assets/support.png")

如果你所文件都在assets/jp里的话,脚本文件就应该是:

fgo = Automata("assets/jp/checkpoint.png", "assets/jp/support.png")
hbw0018 commented 3 years ago

Autumata.txt 这是我现在使用的0.63的文件 其余都没有进行修改,可以进行到 ,关闭/继续战斗的界面。 gubhit一直下载不下来,没法上传本地仓库