{"id":22540774,"url":"https://github.com/gaboolic/klotski-auto-play","last_synced_at":"2025-04-14T19:07:31.667Z","repository":{"id":224480083,"uuid":"761816300","full_name":"gaboolic/klotski-auto-play","owner":"gaboolic","description":"本项目可以截屏后用opencv分割、tensorflow LeNet-5 cnn识别，再用A*算法求解，自动完成新仙剑奇侠传二里的拼图(9x9数字华容道)小游戏。3-puzzles 9-puzzles 15-puzzles 80-puzzles","archived":false,"fork":false,"pushed_at":"2024-03-07T09:32:05.000Z","size":103909,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T19:07:14.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaboolic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-22T14:45:57.000Z","updated_at":"2024-12-14T14:13:02.000Z","dependencies_parsed_at":"2024-03-07T09:42:43.922Z","dependency_job_id":null,"html_url":"https://github.com/gaboolic/klotski-auto-play","commit_stats":null,"previous_names":["gaboolic/klotski-auto-play"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaboolic%2Fklotski-auto-play","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaboolic%2Fklotski-auto-play/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaboolic%2Fklotski-auto-play/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaboolic%2Fklotski-auto-play/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaboolic","download_url":"https://codeload.github.com/gaboolic/klotski-auto-play/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943456,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T12:12:40.602Z","updated_at":"2025-04-14T19:07:31.638Z","avatar_url":"https://github.com/gaboolic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"本项目可以用来识别屏幕图片，自动完成新仙剑奇侠传二里的拼图(数字华容道)小游戏\n\nklotski/klotski99可用来对9x9大小的数字华容道求解，可能是全网唯一一份9x9大小的数字华容道求解python代码\n\npython版本3.10，tensorflow==2.15.0\n\n用uiautomator2控制安卓手机截屏\n\n使用opencv处理图片 灰度 二值化 提取图片序号\n\n使用tensorflow训了个卷积神经网络识别数字\n\n使用dfs搜索拼图移动路径(9x9大小的数字华容道使用A*算法按顺序逐步拼好，先拼n-2层然后拼最后两层，7秒左右耗时，感觉一层层拼可能速度会更快)\n\n最后再把路径转为屏幕坐标 用uiautomator2控制安卓手机点击\n\n99%的代码是引到chatgpt完成再拼凑\n\n安卓控制用https://github.com/openatx/uiautomator2\n\n9x9数字华容道解法参考https://github.com/dkl520/Digital-Huarong-Road\n\n项目路径：\n\n- gameimg 存储游戏图片用于训练\n- klotski 数字华容道解法\n- recognition 使用tensorflow训练、识别数字，有2个模型，一个用来判断是否数字，一个用来识别数字，后来想了想其实用一个网络就行，把num_classes从10改成11就行\n- template 存储分割后的数字模板用于训练\n\nmain.py为主文件\n\ndealnumber.py用来测试图片分割，test.py用来测试图片识别+华容道解法\n\n游戏截图：![demo1](gameimg/99/99.jpg)\n\ntensorflow LeNet-5 cnn数字识别截图：![demo1](img_cnn.png)\n\n9x9数字华容道运行效果（前几步）：![demo1](klotski_run.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaboolic%2Fklotski-auto-play","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaboolic%2Fklotski-auto-play","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaboolic%2Fklotski-auto-play/lists"}