From 743fa0002d0d1588f9c7bbcb2d7dec37215408a0 Mon Sep 17 00:00:00 2001 From: Rbqwow <55343783+Rbqwow@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:01:11 +0800 Subject: [PATCH 01/12] =?UTF-8?q?ci:=20=E4=B8=BA=E6=AD=BB=E9=93=BE?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E5=BD=95=20(#15848)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: 为死链检查工作流指定根目录 * fix: 路径写错了 --- .github/workflows/markdown-checker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/markdown-checker.yml b/.github/workflows/markdown-checker.yml index abd6d09ec9..eb3896ee69 100644 --- a/.github/workflows/markdown-checker.yml +++ b/.github/workflows/markdown-checker.yml @@ -47,6 +47,7 @@ jobs: with: # 仅检查内部链接,排除所有外部链接 args: > + --root-dir ./docs/.vuepress/public --verbose --no-progress --cache --max-cache-age 1d --cache-exclude-status '429, 500..599' --exclude 'https?://.*' From aa89e7080a19e78c70821a69846e0cec19e1f65f Mon Sep 17 00:00:00 2001 From: HY <45387477+momomochi987@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:18:02 +0800 Subject: [PATCH 02/12] =?UTF-8?q?chore:=20=E7=B9=81=E4=B8=AD=E6=9C=8D?= =?UTF-8?q?=E3=80=8C=E5=A2=9F=E3=80=8D=E6=B4=BB=E5=8B=95=E5=B0=8E=E8=88=AA?= =?UTF-8?q?=20(#15849)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/global/txwy/resource/tasks/Stages/AT.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 resource/global/txwy/resource/tasks/Stages/AT.json diff --git a/resource/global/txwy/resource/tasks/Stages/AT.json b/resource/global/txwy/resource/tasks/Stages/AT.json new file mode 100644 index 0000000000..460594aba5 --- /dev/null +++ b/resource/global/txwy/resource/tasks/Stages/AT.json @@ -0,0 +1,8 @@ +{ + "AT-OpenOcr": { + "text": ["墟", "鍛冶", "舊跡", "絕緣", "石階"] + }, + "ATChapterToAT": { + "text": ["不夜街區"] + } +} From 579eef247c0295dad3854230b6bf2eb28cfa0c53 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:50:43 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=88=98?= =?UTF-8?q?=E6=96=97=E5=87=BB=E6=9D=80=E6=95=B0=E8=AF=86=E5=88=AB=E4=BE=BF?= =?UTF-8?q?=E5=AE=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit link to 1bfe044e9d5758b2ee7d055c9dc20c56c67084d5, 9f99058d84d89d06bf931bee685b53562ecee953, 69176a9f1c84e9b52faeac0fc42d8c1668010706, d605d345ffac085842a8f9639d64e29dc2bf1934 --- resource/tasks/tasks.json | 2 +- src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resource/tasks/tasks.json b/resource/tasks/tasks.json index ec5e904b78..4e3d2eee32 100644 --- a/resource/tasks/tasks.json +++ b/resource/tasks/tasks.json @@ -3771,7 +3771,7 @@ "algorithm": "OcrDetect", "isAscii": true, "text": [], - "roi": [50, -20, 100, 40], + "roi": [40, -20, 100, 40], "useRaw": false, "specialParams_doc": "Kill区域变化阈值, 模板匹配, 100=1.0; 正常在 0.997-1 之间波动, 少有0.995; _5->_6 的分数最高, 可达0.94", "specialParams": [98] diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp index fc2b0ba976..8fc4c8b212 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp @@ -284,6 +284,9 @@ BattlefieldMatcher::MatchResult> BattlefieldMatcher::kills_a return {}; } const std::string& kills_text = kills_opt->front().text; + if (kills_text.empty()) { + return {}; + } size_t pos = kills_text.find('/'); if (pos == std::string::npos) { From d0dc152361044ad4537c3e87e15a795d0a9a6108 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Fri, 27 Feb 2026 12:52:55 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=88=98?= =?UTF-8?q?=E6=96=97=E6=9C=80=E5=8F=B3=E4=BE=A7=E5=8D=95=E4=BD=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/tasks/tasks.json b/resource/tasks/tasks.json index 4e3d2eee32..f15baaa56a 100644 --- a/resource/tasks/tasks.json +++ b/resource/tasks/tasks.json @@ -3816,7 +3816,7 @@ }, "BattleOpersFlag": { "templThreshold": 0.65, - "roi": [35, 588, 1210, 18], + "roi": [35, 588, 1245, 18], "maskRange": [1, 255] }, "BattleAvatarReMatch": { From 7d50b80f64123062e807394d9f0afd4f11f4ec24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goat=20Boring=28=E5=B1=B1=E7=BE=8A=E5=8D=9A=E5=AE=8188=29?= <63983700+JasonHuang79@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:24:16 +0800 Subject: [PATCH 05/12] docs: Add dedicated "MAA GUI download and installation guide" (#15138) Co-authored-by: MistEO Co-authored-by: Rbqwow <55343783+Rbqwow@users.noreply.github.com> Co-authored-by: HX3N --- docs/zh-cn/manual/cli/install.md | 2 +- docs/zh-cn/manual/connection.md | 2 +- docs/zh-cn/manual/faq.md | 2 +- docs/zh-cn/manual/install.md | 93 ++++++++++++++++++++++++++++++++ docs/zh-cn/manual/newbie.md | 33 ++++-------- 5 files changed, 107 insertions(+), 25 deletions(-) create mode 100644 docs/zh-cn/manual/install.md diff --git a/docs/zh-cn/manual/cli/install.md b/docs/zh-cn/manual/cli/install.md index 405ef291d1..804550767e 100644 --- a/docs/zh-cn/manual/cli/install.md +++ b/docs/zh-cn/manual/cli/install.md @@ -1,6 +1,6 @@ --- order: 1 -icon: material-symbols:download +icon: material-symbols:download-2-rounded --- # 安装及编译 diff --git a/docs/zh-cn/manual/connection.md b/docs/zh-cn/manual/connection.md index 0d32aa6e5f..87566aa81e 100644 --- a/docs/zh-cn/manual/connection.md +++ b/docs/zh-cn/manual/connection.md @@ -1,5 +1,5 @@ --- -order: 3 +order: 4 icon: mdi:plug --- diff --git a/docs/zh-cn/manual/faq.md b/docs/zh-cn/manual/faq.md index 044fb3cf63..63a7e26588 100644 --- a/docs/zh-cn/manual/faq.md +++ b/docs/zh-cn/manual/faq.md @@ -1,5 +1,5 @@ --- -order: 2 +order: 3 icon: ph:question-fill --- diff --git a/docs/zh-cn/manual/install.md b/docs/zh-cn/manual/install.md new file mode 100644 index 0000000000..920c908f91 --- /dev/null +++ b/docs/zh-cn/manual/install.md @@ -0,0 +1,93 @@ +--- +order: 2 +icon: material-symbols:download-2-rounded +--- + + + +# 下载与安装 + +> [tip] +> +>你正在查阅 MAA GUI 的下载与安装说明文档。若你需要查阅 maa-cli 的下载与安装说明,请访问 maa-cli 的 [安装及编译](./cli/install.md) 文档。目前安卓牛牛(MAA 安卓版)已开放测试,请前往 [MAA-Meow](https://github.com/Aliothmoon/MAA-Meow) 了解更多情况。 + + + +## 下载 MAA + +MAA 提供多种下载方式,包括官网下载,从包管理器安装,群文件下载等方式。请选择适合你的方式进行下载。 + +### 通过 [官网](https://maa.plus) 下载最新的 MAA 软件包 + +官网一般会自动选择正确的版本架构,对于大多数阅读本文的用户来说,应为 Windows x64。对于阅读本文的 macOS 用户来说,应下载 macOS 通用版。 + +### 通过 [Mirror酱](https://mirrorchyan.com/zh/projects?rid=MAA&source=maadocs-install) 下载最新的 MAA 软件包 + +请确认系统架构并下载对应的软件包。对于大多数阅读本文的 Windows 用户来说,应为 Windows x64。对于阅读本文的 Mac 用户,Mirror酱 不提供通用软件包,请确认您的芯片架构(arm/x86)后下载对应的软件包。 + +::: tip + +[Mirror酱](https://mirrorchyan.com/zh/projects?rid=MAA&source=maadocs-install) 是独立的第三方下载加速服务,需要付费使用,而非 MAA 收费。其运营成本由订阅收入支撑,部分收益将回馈项目开发者。欢迎订阅 CDK 享受高速下载,同时支持项目持续开发。 + +::: + +### 使用 Windows 包管理器(Winget)安装 + +::: tip + +本方法仅适用于使用 Windows 的用户 + +::: + +请在终端中运行以下命令: + +```bash +winget install maa +``` + +通过此方式安装的默认安装路径为 `C:\Users\用户名\AppData\Local\Microsoft\WinGet\Packages`。 + +### 通过 QQ 群文件下载最新的 MAA 软件包 + +1. 加入 [MAA 官方 QQ 群](https://api.maa.plus/MaaAssistantArknights/api/qqgroup/index.html) +2. 在群文件中找到最新的 MAA 软件包进行下载。 + +### 通过 [GitHub Releases](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases) 下载最新的 MAA 软件包 + +请确认系统架构并下载对应的软件包。对于大多数阅读本文的 Windows 用户来说,应为 `MAA-<版本号>-win-x64.zip`。对于阅读本文的 macOS 用户来说,应选择 `MAA-<版本号>-macos-universal.dmg`。 + +## Linux 和其他操作系统 + +MAA GUI **暂未支持** Linux 和其他操作系统。你可以使用 **maa-cli** 来在这些系统上使用 MAA 的功能。请访问 maa-cli 的 [安装及编译](./cli/install.md) 文档了解更多信息。 + +## 安装 MAA + +### Windows + +下载完成后,你会得到一个 `.zip` 文件。用解压缩软件将其完全解压后,会得到一个包含 MAA 所有文件的文件夹。 + +::: warning + +1.请不要将 MAA 解压到如 `C:\`、`C:\Program Files\` 等需要 UAC 权限的路径。 + +2.MAA 需要 Visual C++ Redistributable x64(VCRedist x64)和 .NET 10 。请在解压后的 MAA 目录中以管理员身份运行 `DependencySetup_依赖库安装.bat` 来安装这些依赖。安装完成后再运行 `maa.exe`。 + +更多信息请参考[常见问题](./faq.md)置顶。 + +::: + +双击 `MAA.exe` 即可启动 MAA。 + +::: tip + +通过 Windows 包管理器(Winget)安装的用户,可直接在命令行中输入 `maa` 来启动 MAA 而无需解压缩、安装运行库等额外操作。若 PATH 中有 `maa-cli`,可能需要额外步骤以区分二者。 + +::: + +### macOS + +下载完成后,你会得到一个 `.dmg` 文件。双击打开该 `.dmg`,将 `MAA.app` 拖入 `/Applications` 以完成安装。 + +## 后续步骤 + +安装完成后,请返回 [新手上路](./newbie.md) 继续配置,或前往 [功能介绍](./introduction/) 查看 MAA 支持的各项功能吧!若您在安装中遇到问题,可以尝试查阅 [常见问题](./faq.md) 来解决问题。 diff --git a/docs/zh-cn/manual/newbie.md b/docs/zh-cn/manual/newbie.md index 7de9e5af7e..1be5099b8d 100644 --- a/docs/zh-cn/manual/newbie.md +++ b/docs/zh-cn/manual/newbie.md @@ -17,28 +17,19 @@ icon: ri:guide-fill 非 Windows 用户请参阅[模拟器及设备支持](./device/)。 -2. 下载正确的版本 - - [MAA 官网](https://maa.plus/)一般会自动选择正确的版本架构,对于大多数阅读本文的用户来说,应为 Windows x64。 - -3. 正确解压 - - 确认解压完整,并确保将 MAA 解压到一个独立的文件夹中。请勿将 MAA 解压到如 `C:\`、`C:\Program Files\` 等需要 UAC 权限的路径。 - -4. 安装运行库 - - MAA 需要 VCRedist x64 和 .NET 10,请运行 MAA 目录下的 `DependencySetup_依赖库安装.bat` 以安装。 - - 更多信息请参考[常见问题](./faq.md)置顶。 - -5. 确认模拟器支持 +2. 确认模拟器支持 查阅[模拟器和设备支持](./device/),确认正在使用的模拟器支持情况。 -6. 正确设置模拟器分辨率 +3. 下载与安装 + + 查阅[下载与安装](./install.md)。 + +4. 正确设置模拟器分辨率 模拟器分辨率应为横屏的 `1280x720` 或 `1920x1080`;对于美服(YosterEN)玩家,必须为 `1920x1080`。 - :::: + +:::: ## 初始配置 @@ -64,12 +55,10 @@ icon: ri:guide-fill **遇到问题多看文档多看文档多看文档**    **遇到问题多看文档多看文档多看文档**    **遇到问题多看文档多看文档多看文档** ::: -1. 运行日志位于 MAA 文件夹下的 `debug` 文件夹内。日志很重要,非常重要。向他人寻求帮助时,请务必带着 `asst.log` 和 `gui.log` 一同前去。 +1. 使用 `设置` - `问题反馈` - `生成日志压缩包` 可生成便于共享的日志压缩包。日志很重要,非常重要。向他人寻求帮助时,请务必带着日志压缩包一同前去。 2. MAA 为了尽可能满足所有用户的各种需求,提供了大量的自定义选项。在认为 MAA 缺少了某项功能时,有可能只是没找到而不是 MAA 没有,如 `手动输入关卡名` 和 `不将已进驻的干员放入宿舍`。 -3. 将鼠标指针放在某些选项上会给出详细说明,如 `不将已进驻的干员放入宿舍`。 +3. 对于部分复选框,在其上右键单击可以将其变为半选状态,这种状态下的复选框会在 MAA 下一次启动时自动清除,可以理解为 `仅一次`。 -4. 对于部分复选框来说,在其上右键单击可以将其变为半选状态,这种状态下的复选框会在 MAA 下一次启动时自动清除,可以理解为 `仅一次`。 - -5. ~~如果不知道自己需要什么,不方便解决有可能会出现的问题,请勿使用内测版。~~ +4. ~~如果不知道自己需要什么,不方便解决有可能会出现的问题,请勿使用内测版。~~ From a038f2d403bf6ec34ab55a5d8ca6447458fbe96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goat=20Boring=28=E5=B1=B1=E7=BE=8A=E5=8D=9A=E5=AE=8188=29?= <63983700+JasonHuang79@users.noreply.github.com> Date: Fri, 27 Feb 2026 16:42:01 +0800 Subject: [PATCH 06/12] =?UTF-8?q?docs:=20=E4=BF=AE=E6=97=8F=E8=B0=B1=20(#1?= =?UTF-8?q?5856)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把其中一个容器修一下 --- docs/zh-cn/manual/install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/zh-cn/manual/install.md b/docs/zh-cn/manual/install.md index 920c908f91..ff2ee22648 100644 --- a/docs/zh-cn/manual/install.md +++ b/docs/zh-cn/manual/install.md @@ -7,11 +7,11 @@ icon: material-symbols:download-2-rounded # 下载与安装 -> [tip] -> ->你正在查阅 MAA GUI 的下载与安装说明文档。若你需要查阅 maa-cli 的下载与安装说明,请访问 maa-cli 的 [安装及编译](./cli/install.md) 文档。目前安卓牛牛(MAA 安卓版)已开放测试,请前往 [MAA-Meow](https://github.com/Aliothmoon/MAA-Meow) 了解更多情况。 +::: tip +你正在查阅 MAA GUI 的下载与安装说明文档。若你需要查阅 maa-cli 的下载与安装说明,请访问 maa-cli 的 [安装及编译](./cli/install.md) 文档。目前安卓牛牛(MAA 安卓版)已开放测试,请前往 [MAA-Meow](https://github.com/Aliothmoon/MAA-Meow) 了解更多情况。 +::: ## 下载 MAA From ed05041d09b20ecaa6ed4e4f760dcf8f2b60a8b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 27 Feb 2026 21:07:53 +0000 Subject: [PATCH 07/12] chore: Auto update by pre-commit hooks https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/22503800132 [skip changelog] --- docs/zh-cn/manual/newbie.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh-cn/manual/newbie.md b/docs/zh-cn/manual/newbie.md index 1be5099b8d..1a3715501a 100644 --- a/docs/zh-cn/manual/newbie.md +++ b/docs/zh-cn/manual/newbie.md @@ -28,7 +28,7 @@ icon: ri:guide-fill 4. 正确设置模拟器分辨率 模拟器分辨率应为横屏的 `1280x720` 或 `1920x1080`;对于美服(YosterEN)玩家,必须为 `1920x1080`。 - + :::: ## 初始配置 From d1fdf5b9a81afdc700017539a7d988766040cba8 Mon Sep 17 00:00:00 2001 From: Status102 <102887808+status102@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:51:18 +0800 Subject: [PATCH 08/12] =?UTF-8?q?rft:=20=E9=87=8D=E6=9E=84=E6=88=98?= =?UTF-8?q?=E6=96=97=E4=B8=AD=E5=87=BB=E6=9D=80=E8=AF=86=E5=88=AB,=20?= =?UTF-8?q?=E5=87=BB=E6=9D=80=E5=9B=BE=E6=A0=87=E5=8C=B9=E9=85=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=AB=98=E6=96=AF=E6=A8=A1=E7=B3=8A=E9=A2=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=20(#15868)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "chore: Auto Templates Optimization" This reverts commit 89a7f939600cf447a48d876a168801e508eac602. Revert "fix: 沟槽的 yj 怎么有倒计时的时候击杀数图标都不一样" This reverts commit 9f99058d84d89d06bf931bee685b53562ecee953. Revert "chore: Auto Templates Optimization" This reverts commit 4e2fdc45521cd58573bb973928db5326a9a74de4. Revert "perf: 优化击杀数模板图" This reverts commit d605d345ffac085842a8f9639d64e29dc2bf1934. * rft: 重构战斗中击杀识别 * chore: remove debug code Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * chore: roi恢复 --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- resource/tasks/tasks.json | 2 +- .../Battle/BattleFlag/BattleKillsFlag.png | Bin 318 -> 2518 bytes .../Vision/Battle/BattlefieldMatcher.cpp | 65 +++++++++++++----- .../Vision/Battle/BattlefieldMatcher.h | 2 +- .../OptimizeTemplates/optimize_templates.json | 2 +- 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/resource/tasks/tasks.json b/resource/tasks/tasks.json index f15baaa56a..2ff257f35b 100644 --- a/resource/tasks/tasks.json +++ b/resource/tasks/tasks.json @@ -3771,7 +3771,7 @@ "algorithm": "OcrDetect", "isAscii": true, "text": [], - "roi": [40, -20, 100, 40], + "roi": [50, 0, 100, 40], "useRaw": false, "specialParams_doc": "Kill区域变化阈值, 模板匹配, 100=1.0; 正常在 0.997-1 之间波动, 少有0.995; _5->_6 的分数最高, 可达0.94", "specialParams": [98] diff --git a/resource/template/Battle/BattleFlag/BattleKillsFlag.png b/resource/template/Battle/BattleFlag/BattleKillsFlag.png index 79b82c37ca0f09b5123c46f9589b3fbb597f3588..87889a22b3e4fa6e9861044c80e1764e4d5c41c2 100644 GIT binary patch literal 2518 zcmV;{2`To8P)h2Qig7*LFg4IHy?kx^=cYE&c?poL9?(XjCd!%LmXD1ml`OPM! zyng0P=kDFR=N>PB=Fm4;zP%u?A^WDSh=@`a1}wA)J1Zy zgHaD>iZAkCFO|Pr=1Z9>Fby@Vu?3l}1q6reK3UR?Af-fWo^^2blo5odi+QppLS_MQ zY6Pc70@#rowk;<>yIp0CO}J%zFq_C+(b(9GAmy}`JZlh)eR-mLEdW)9I5Cg;70JLuh_q&Rz9?axh!n8|WIpHD4~1C=8T4FGii2h#yz_ zEf6`zy&i4s9IV)#EuF1k5duZzNaOIf7R?nOsZt4_o~`>Q_*~i8U|Qp;^4-@^#Tu(X zn_n*WclGHq%~)rhnh1rXAazO95sZ0Go!W%8`g(K+ne;Z%E?OYdjT*+N^Bd%;Wa*JM z=_K_we4~LOo#Q)-u!3Gq>lNIfYsV<=avoNEIF~==^85YFG=*-ZJ`XUc%6z0vdi7ww ze`=hWrGLMKg%$1!{+97Fg7He3c+90(yRsIt;8*(963N&M@6<6?n_*yCh8E@{ZEgWg zfq?3+x6azDW%8L4!D8SNl&OCz`41QQ%0AJqk$Bgs5jFT= z^Ykl6`;P6+Qy-fu-#$UPr$Cw8S81}Ki$fw?GutX;G|h3IBcX*U-z=5CSje}D)2K#$ z4v+3+Gq%HYYn2&o5?cJP)cdkSYj0FybO9lWwFwkdpW0d&ludK2ld1r<=c+lQmhnAq z!=!FHTF2@O2k29}+vfDs-R100%f;jfKFux^_0&mvBuJg&L~`AzV~&+YbalwN?bRWz z6iwoiBE_~bQtN0*@ukwtDK(B=<#dTvMUFypSx2RtL%M59*k6^*m6s_KyOK_AYA>Cn zb(BEz>q_D0Wn5`ry`YD_c%YUV9au2$&J~WiRLlQF$vH&~7$;k^Rq~0-g`D$33-fU+ zRtyZ#8?NwFLzWzysnVqg#=`~jpXJuCe_hUYi{}wYMvCOkix+P;&0!sgGf8k)!jd1C ziO)}y5R8qPni0g6%vJ(r4OZABu9HLSlAuz)U`1mcvm(R#RtoBx;VOcW+1^GY#3ozl zrM@8VHIaoCPZVn;utMe;n%x3t;Y_a-odP_vosM8oA9`xx>LtU9@_|xg4SVfa^}z!5 z)GUSMxJ!L@nkm1n6n|YQ(X>1`gZAa4F6HP<<=}MXwh0Q2&0s%=P;BTro@Eh&TgEBw zO6wDE&XsAL_?mgOPkifI65nHhtTi`Jl_;>Hp@z9@qKwe=NVa*_qg9lMKu)X!~$p7@9*ydYES;O8fc0Uq3R;*a+$}qt<&X8Al=-HJmxV>uJ=o zrqq)#bd26MR+Eqew5IcBL)Pf~*q*~L@5AQDVstEW zqA@^1zc37p$IuvL*_q5}t{@q6+hOepW&3b-Q8E%Fq^M9ChzxWQ8jluo@4ffFaQF51 zU%m6;+pd20!JFof?VXt}=Cu(!Nf^;q*|BVLRYAs*{DFs`x~Ft{{)Ef2#^#N9=B{ft zEh!n8s^@fx6j=xiB%bm92--F!aq-xUk!j-E`Na(FTr62x*@j{4ShaF+YT`6!yW;*` zrVeQJ!P~EX_w{G&9Gjb_{O$gy z!SnB9ckaJtZTS!1|NPR?r)!s%(y{z8xu!uJo0)ERM&hdv->1!avx>3@b${v9@$=_A z>z2Z=XJ<>t%Cjv0~n|^(DhH)1=>i{q@~52S>CDyJ=f_ zW8?YbPv2j&cqSdY^QPkWd-iVt0>d1C<`Fs&p-HjfT6IhaYp=F+k2Hk8Kz zZGkijZ4|!$;$zyR(&2&E&m5w4v`q$(mpSr_FTOy_a5x;Kh$<;2Ix3@Qr`E}dBG3K) z=U;z)_MtNj5|6v?xo=L%bVpna9eexq(KU-ow^x;IuP9kIruPqDeMXxA1mOKQU!t}5 zF9iep_d9&_7+MU=vhfZ_YHCvdo}JsLrvQ*deo?`QjCe-k&_qO-wti{J_R9HNYZh#) zD=QtkagoKM{2^=R=G#P8Vi;U17(fGb4l;uwk*FHR=caS*Rm97PlAtnh z0s~kK6fjsrjsw{mMsg_afCW8}t714%(;bmAi%UhfIN|hE;kiQjaEW}dOnz^P^ygCH zhk4?=F80+Kcx48jD3l(aqC8bB9CG2H3rC8Cqmz}FT{6j`N%F~J`G=MK%w7^M73bGP z83$nOgs}^zY=f~C#tvHh#9Y(c?J#!3*au@T3FCW3YudRI#u^2eigvN;mHDyzCdHdF zF@Dd)_?;7CcZ`qSH9l_FgoK?F6820<-#s~PZ(+NwV;q}u!#3vHHsytxGKwU8Q(pM? g(P6ElMKpu|2X1J@UH(g7x&QzG07*qoM6N<$g5k&eg#Z8m literal 318 zcmV-E0m1%>P)Px#32;bRa{vGi!T-Evs-va0_sINDkyH2=9S{Y`D|%g4`-8xy^EJp3dl z@t_*QIA@#67oXs@iT4(MI?5ypzg_%v@zvq``B6E(iPL`hY1Hthl+dZ_0e%zQ7y%3Z QPXGV_07*qoM6N<$f-ORdv;Y7A diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp index 8fc4c8b212..64489cc85d 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp @@ -273,17 +273,27 @@ bool BattlefieldMatcher::kills_flag_analyze() const BattlefieldMatcher::MatchResult> BattlefieldMatcher::kills_analyze() const { - if (hit_kills_cache()) { + auto [hit_cache, flag_rect] = hit_kills_cache(); + if (hit_cache) { return { .status = MatchStatus::HitCache }; } - TemplDetOCRer kills_analyzer(m_image); - kills_analyzer.set_task_info("BattleKillsFlag", "BattleKills"); - kills_analyzer.set_replace(Task.get("NumberOcrReplace")->replace_map); - auto kills_opt = kills_analyzer.analyze(); + + if (flag_rect == std::nullopt) { + LogWarn << __FUNCTION__ << "kill flag not found"; + return {}; + } + + const auto& ocr_task = Task.get("BattleKills"); + RegionOCRer flag_analyzer(m_image); + flag_analyzer.set_roi(flag_rect->move(ocr_task->roi)); + flag_analyzer.set_use_char_model(ocr_task->is_ascii); + flag_analyzer.set_use_raw(ocr_task->use_raw); + flag_analyzer.set_replace(Task.get("NumberOcrReplace")->replace_map); + auto kills_opt = flag_analyzer.analyze(); if (!kills_opt) { return {}; } - const std::string& kills_text = kills_opt->front().text; + const std::string& kills_text = kills_opt->text; if (kills_text.empty()) { return {}; } @@ -341,19 +351,36 @@ BattlefieldMatcher::MatchResult> BattlefieldMatcher::kills_a return { .value = std::make_pair(kills, total_kills), .status = MatchStatus::Success }; } -bool asst::BattlefieldMatcher::hit_kills_cache() const +std::pair> asst::BattlefieldMatcher::hit_kills_cache() const { - if (m_image_prev.empty() || m_image.cols != m_image_prev.cols || m_image.rows != m_image_prev.rows) { - return false; - } - Matcher flag_match(m_image); - flag_match.set_task_info("BattleKillsFlag"); + const auto& flag_task = Task.get("BattleKillsFlag"); + cv::Mat template_image = TemplResource::get_instance().get_templ("BattleKillsFlag.png"); + cv::Mat match_image = make_roi(m_image, flag_task->roi); + + // 对模板图和截图都进行一次模糊,减少yj缩放对文字及细节的影响,提升命中率 + cv::Mat template_blur, image_blur; + cv::GaussianBlur(template_image, template_blur, cv::Size(3, 3), 0); + cv::GaussianBlur(match_image, image_blur, cv::Size(3, 3), 0); + + Matcher flag_match(image_blur); + flag_match.set_mask_ranges(flag_task->mask_ranges); + flag_match.set_roi({ 0, 0, flag_task->roi.width, flag_task->roi.height }); + flag_match.set_templ(template_blur); + flag_match.set_method(MatchMethod::Ccoeff); + flag_match.set_threshold(flag_task->templ_thresholds); if (!flag_match.analyze()) { - return false; + return { false, std::nullopt }; } - const auto& flag_rect = flag_match.get_result().rect; - const auto& task = Task.get("BattleKills"); - const auto& roi = flag_rect.move(task->roi); + + auto flag_rect = flag_match.get_result().rect; + flag_rect.x += flag_task->roi.x; + flag_rect.y += flag_task->roi.y; + if (m_image_prev.empty() || m_image.size != m_image_prev.size) { + return { false, flag_rect }; + } + + const auto& ocr_task = Task.get("BattleKills"); + const auto& roi = flag_rect.move(ocr_task->roi); cv::Mat kills_image_cache = make_roi(m_image_prev, roi); cv::Mat kills_image = make_roi(m_image, roi); @@ -365,8 +392,8 @@ bool asst::BattlefieldMatcher::hit_kills_cache() const cv::minMaxLoc(match, nullptr, &mark); // 正常在 0.997-1 之间波动, 少有0.995 // _5->_6 的分数最高, 可达0.94 - const double threshold = static_cast(task->special_params[0]) / 100; - return mark > threshold; + const double threshold = static_cast(ocr_task->special_params[0]) / 100; + return { mark > threshold, flag_rect }; } bool BattlefieldMatcher::cost_symbol_analyze() const @@ -397,7 +424,7 @@ BattlefieldMatcher::MatchResult BattlefieldMatcher::costs_analyze() const bool asst::BattlefieldMatcher::hit_costs_cache() const { - if (m_image_prev.empty() || m_image.cols != m_image_prev.cols || m_image.rows != m_image_prev.rows) { + if (m_image_prev.empty() || m_image.size != m_image_prev.size) { return false; } const auto& task = Task.get("BattleCostData"); diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h index 9298803ca9..79aa666136 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h @@ -69,7 +69,7 @@ protected: MatchResult> kills_analyze() const; // 识别击杀数 // 识别是否持有费用是否命中缓存 - bool hit_kills_cache() const; + std::pair> hit_kills_cache() const; bool cost_symbol_analyze() const; // 识别费用左侧图标 MatchResult costs_analyze() const; // 识别费用 // 识别是否持有费用是否命中缓存 diff --git a/tools/OptimizeTemplates/optimize_templates.json b/tools/OptimizeTemplates/optimize_templates.json index 41582ab88c..d17e410de9 100644 --- a/tools/OptimizeTemplates/optimize_templates.json +++ b/tools/OptimizeTemplates/optimize_templates.json @@ -2653,7 +2653,7 @@ "resource/template/Battle/BattleFlag/EndOfAction": "3a4e90ae88d0ff83304c793bd05695335888d67d0b3224066a22b465c5f53f0b", "resource/template/Battle/BattleFlag/BattleSpeedUp": "f81a6ea54970ec3fdfbea14c2887e067e60ca3ba7d3c7168da7b19c5a62c91ca", "resource/template/Battle/BattleFlag/BattleSkillReadyOnClick-TopView2": "9de4d366eab581c30dfde35346a94197727a6397e7c8f99da07a828f70b89607", - "resource/template/Battle/BattleFlag/BattleKillsFlag": "e167dd5a8ef789c7626eb463110d1899d1987a84003ff9d15fa9a4ddf34103f5", + "resource/template/Battle/BattleFlag/BattleKillsFlag": "7b5db70e0fd69ea0f09db643d6e3c31999fe521a6439fe3ab47aa85a014f3b59", "resource/template/Battle/BattleFlag/AbandonAction": "052a60fec1eb98ff3ab12814e40426ff682377b89c9ee844d3cff210c662559e", "resource/template/Battle/BattleFlag/BattleSkillReady": "6dcb381619811d91419ffda02fa4764908e3d61107abe2ecd0c8e92b631a6746", "resource/template/Battle/BattleFlag/PrtsErrorConfirm": "57ce7a88d0a231a8b77ea24c7f69e4cce65038095dda68d6782afddbcd37566e", From 7e7b9b388b5b88816996b424159af65f49b42d90 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sat, 28 Feb 2026 12:53:13 +0800 Subject: [PATCH 09/12] =?UTF-8?q?rft:=20=E4=BF=AE=E6=94=B9=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip changelog] --- .../Vision/Battle/BattlefieldMatcher.cpp | 62 +++++++++---------- .../Vision/Battle/BattlefieldMatcher.h | 2 +- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp index 64489cc85d..b95f04fa9d 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.cpp @@ -273,19 +273,37 @@ bool BattlefieldMatcher::kills_flag_analyze() const BattlefieldMatcher::MatchResult> BattlefieldMatcher::kills_analyze() const { - auto [hit_cache, flag_rect] = hit_kills_cache(); - if (hit_cache) { - return { .status = MatchStatus::HitCache }; - } + const auto& flag_task = Task.get("BattleKillsFlag"); + cv::Mat template_image = TemplResource::get_instance().get_templ("BattleKillsFlag.png"); + cv::Mat match_image = make_roi(m_image, flag_task->roi); - if (flag_rect == std::nullopt) { + // 对模板图和截图都进行一次模糊,减少yj缩放对文字及细节的影响,提升命中率 + cv::Mat template_blur, image_blur; + cv::GaussianBlur(template_image, template_blur, cv::Size(3, 3), 0); + cv::GaussianBlur(match_image, image_blur, cv::Size(3, 3), 0); + + Matcher flag_match(image_blur); + flag_match.set_mask_ranges(flag_task->mask_ranges); + flag_match.set_roi({ 0, 0, flag_task->roi.width, flag_task->roi.height }); + flag_match.set_templ(template_blur); + flag_match.set_method(MatchMethod::Ccoeff); + flag_match.set_threshold(flag_task->templ_thresholds); + if (!flag_match.analyze()) { LogWarn << __FUNCTION__ << "kill flag not found"; return {}; } + auto flag_rect = flag_match.get_result().rect; + flag_rect.x += flag_task->roi.x; + flag_rect.y += flag_task->roi.y; + + if (hit_kills_cache(flag_rect)) { + return { .status = MatchStatus::HitCache }; + } + const auto& ocr_task = Task.get("BattleKills"); RegionOCRer flag_analyzer(m_image); - flag_analyzer.set_roi(flag_rect->move(ocr_task->roi)); + flag_analyzer.set_roi(flag_rect.move(ocr_task->roi)); flag_analyzer.set_use_char_model(ocr_task->is_ascii); flag_analyzer.set_use_raw(ocr_task->use_raw); flag_analyzer.set_replace(Task.get("NumberOcrReplace")->replace_map); @@ -351,39 +369,17 @@ BattlefieldMatcher::MatchResult> BattlefieldMatcher::kills_a return { .value = std::make_pair(kills, total_kills), .status = MatchStatus::Success }; } -std::pair> asst::BattlefieldMatcher::hit_kills_cache() const +bool asst::BattlefieldMatcher::hit_kills_cache(Rect flag_rect) const { - const auto& flag_task = Task.get("BattleKillsFlag"); - cv::Mat template_image = TemplResource::get_instance().get_templ("BattleKillsFlag.png"); - cv::Mat match_image = make_roi(m_image, flag_task->roi); - - // 对模板图和截图都进行一次模糊,减少yj缩放对文字及细节的影响,提升命中率 - cv::Mat template_blur, image_blur; - cv::GaussianBlur(template_image, template_blur, cv::Size(3, 3), 0); - cv::GaussianBlur(match_image, image_blur, cv::Size(3, 3), 0); - - Matcher flag_match(image_blur); - flag_match.set_mask_ranges(flag_task->mask_ranges); - flag_match.set_roi({ 0, 0, flag_task->roi.width, flag_task->roi.height }); - flag_match.set_templ(template_blur); - flag_match.set_method(MatchMethod::Ccoeff); - flag_match.set_threshold(flag_task->templ_thresholds); - if (!flag_match.analyze()) { - return { false, std::nullopt }; - } - - auto flag_rect = flag_match.get_result().rect; - flag_rect.x += flag_task->roi.x; - flag_rect.y += flag_task->roi.y; if (m_image_prev.empty() || m_image.size != m_image_prev.size) { - return { false, flag_rect }; + return false; } const auto& ocr_task = Task.get("BattleKills"); const auto& roi = flag_rect.move(ocr_task->roi); - cv::Mat kills_image_cache = make_roi(m_image_prev, roi); - cv::Mat kills_image = make_roi(m_image, roi); + cv::Mat kills_image_cache = make_roi(m_image_prev, correct_rect(roi, m_image_prev)); + cv::Mat kills_image = make_roi(m_image, correct_rect(roi, m_image)); cv::cvtColor(kills_image_cache, kills_image_cache, cv::COLOR_BGR2GRAY); cv::cvtColor(kills_image, kills_image, cv::COLOR_BGR2GRAY); cv::Mat match; @@ -393,7 +389,7 @@ std::pair> asst::BattlefieldMatcher::hit_kills_cache() // 正常在 0.997-1 之间波动, 少有0.995 // _5->_6 的分数最高, 可达0.94 const double threshold = static_cast(ocr_task->special_params[0]) / 100; - return { mark > threshold, flag_rect }; + return mark > threshold; } bool BattlefieldMatcher::cost_symbol_analyze() const diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h index 79aa666136..58c9e66df6 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h @@ -69,7 +69,7 @@ protected: MatchResult> kills_analyze() const; // 识别击杀数 // 识别是否持有费用是否命中缓存 - std::pair> hit_kills_cache() const; + bool hit_kills_cache(Rect flag_rect) const; bool cost_symbol_analyze() const; // 识别费用左侧图标 MatchResult costs_analyze() const; // 识别费用 // 识别是否持有费用是否命中缓存 From b68c51c9707342abb1a73c5c16d3d8d13bf0fe81 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sat, 28 Feb 2026 12:57:32 +0800 Subject: [PATCH 10/12] =?UTF-8?q?chore:=20=E6=B3=A8=E9=87=8A=E6=A0=87?= =?UTF-8?q?=E9=94=99=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Vision/Battle/BattlefieldMatcher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h index 58c9e66df6..330473fb7d 100644 --- a/src/MaaCore/Vision/Battle/BattlefieldMatcher.h +++ b/src/MaaCore/Vision/Battle/BattlefieldMatcher.h @@ -68,11 +68,11 @@ protected: bool oper_available_analyze(const Rect& roi) const; MatchResult> kills_analyze() const; // 识别击杀数 - // 识别是否持有费用是否命中缓存 + // 识别击杀数是否命中缓存 bool hit_kills_cache(Rect flag_rect) const; bool cost_symbol_analyze() const; // 识别费用左侧图标 MatchResult costs_analyze() const; // 识别费用 - // 识别是否持有费用是否命中缓存 + // 识别持有费用是否命中缓存 bool hit_costs_cache() const; bool in_detail_analyze() const; // 识别是否在详情页 bool speed_button_analyze() const; // 识别是否有加速按钮(在详情页就没有) From e69dc574771c3390de209663efb58c30211807aa Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:10:11 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:=20correct=5Frect=E5=9C=A8x=20y?= =?UTF-8?q?=E8=B4=9F=E6=96=B9=E5=90=91=E8=B6=85=E9=99=90=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B,=20=E6=A0=A1?= =?UTF-8?q?=E6=AD=A3=E5=90=8Ewidth=20height=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks/tasks.json | 6 ++++ src/MaaCore/Task/Interface/DebugTask.cpp | 42 ++++++++++++++++++++++++ src/MaaCore/Vision/VisionHelper.cpp | 20 +++++++++-- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/resource/tasks/tasks.json b/resource/tasks/tasks.json index 2ff257f35b..ebae48b27f 100644 --- a/resource/tasks/tasks.json +++ b/resource/tasks/tasks.json @@ -3934,6 +3934,12 @@ "text": [], "roi": [73, 378, 221, 31] }, + "StageDrops-NoDropCheck": { + "template": "empty.png", + "roi": [60, 510, 150, 160], + "specialParams_Doc": "灰度过滤阈值", + "specialParams": [120] + }, "StageDrops-BaseLine": { "template": "empty.png", "roi": [0, 636, 1280, 2], diff --git a/src/MaaCore/Task/Interface/DebugTask.cpp b/src/MaaCore/Task/Interface/DebugTask.cpp index e723ae7a73..a300b967c2 100644 --- a/src/MaaCore/Task/Interface/DebugTask.cpp +++ b/src/MaaCore/Task/Interface/DebugTask.cpp @@ -1,6 +1,9 @@ #include "DebugTask.h" +#include "MaaUtils/Encoding.h" +#include #include +#include #include "Common/AsstTypes.h" #include "Config/TaskData.h" @@ -9,7 +12,10 @@ #include "Utils/Logger.hpp" #include "Vision/Battle/BattlefieldClassifier.h" #include "Vision/Battle/BattlefieldMatcher.h" +#include "Vision/BestMatcher.h" +#include "Vision/FeatureMatcher.h" #include "Vision/Matcher.h" +#include "Config/TemplResource.h" #include "Vision/Miscellaneous/DepotImageAnalyzer.h" #include "Vision/Miscellaneous/StageDropsImageAnalyzer.h" #include "Vision/MultiMatcher.h" @@ -23,6 +29,42 @@ asst::DebugTask::DebugTask(const AsstCallback& callback, Assistant* inst) : bool asst::DebugTask::run() { + auto image_dep = MaaNS::imread(utils::path("C:\\Users\\status102\\Desktop\\deploy.png")); + static const std::unordered_map RoleMap = { + { "Caster", battle::Role::Caster }, { "Medic", battle::Role::Medic }, { "Pioneer", battle::Role::Pioneer }, + { "Sniper", battle::Role::Sniper }, { "Special", battle::Role::Special }, { "Support", battle::Role::Support }, + { "Tank", battle::Role::Tank }, { "Warrior", battle::Role::Warrior }, { "Drone", battle::Role::Drone }, + }; + + auto image = MaaNS::imread(utils::path("C:\\Users\\status102\\Desktop\\kill_1080p_Vec.png")); + + cv::Mat template_image = TemplResource::get_instance().get_templ("BattleKillsFlag.png"); + auto task = Task.get("BattleKillsFlag"); + + // 对模板进行高斯模糊预处理(解决小尺寸模板的细线条缩放问题) + cv::Mat template_blurred; + cv::GaussianBlur(template_image, template_blurred, cv::Size(3, 3), 0); + + // 同时对输入图像应用相同的模糊处理 + cv::Mat image_blurred; + cv::GaussianBlur(make_roi(image, task->roi), image_blurred, cv::Size(3, 3), 0); + + // 使用模糊后的图像进行匹配 + Matcher analyzer(image_blurred); + analyzer.set_task_info("BattleKillsFlag"); + analyzer.set_roi({ 0, 0, task->roi.width, task->roi.height }); + if (!analyzer.analyze()) { + Log.info("flag not found"); + } + // 使用模糊后的图像进行匹配 + Matcher analyzer2(image_blurred); + analyzer2.set_task_info("BattleKillsFlag"); + analyzer2.set_templ(template_blurred); + analyzer2.set_roi({ 0, 0, task->roi.width, task->roi.height }); + if (!analyzer2.analyze()) { + Log.info("flag not found"); + } + return true; } diff --git a/src/MaaCore/Vision/VisionHelper.cpp b/src/MaaCore/Vision/VisionHelper.cpp index 79804adeb7..3514f9ca10 100644 --- a/src/MaaCore/Vision/VisionHelper.cpp +++ b/src/MaaCore/Vision/VisionHelper.cpp @@ -14,12 +14,18 @@ using namespace asst; VisionHelper::VisionHelper(const cv::Mat& image, const Rect& roi, Assistant* inst) : InstHelper(inst), - m_image(image), + m_image(image) #ifdef ASST_DEBUG - m_image_draw(image.clone()), + , + m_image_draw(image.clone()) #endif - m_roi(correct_rect(roi, image)) { + if (roi.empty()) { + m_roi = { 0, 0, image.cols, image.rows }; + } + else { + m_roi = correct_rect(roi, image); + } } void VisionHelper::set_image(const cv::Mat& image) @@ -90,6 +96,14 @@ Rect VisionHelper::correct_rect(const Rect& rect, const cv::Mat& image) } Rect res = rect; + if (res.x < 0) { + res.x = 0; + res.width += rect.x; + } + if (res.y < 0) { + res.y = 0; + res.height += rect.y; + } res.x = std::clamp(res.x, 0, image.cols - 1); res.y = std::clamp(res.y, 0, image.rows - 1); res.width = std::clamp(res.width, 1, image.cols - res.x); From 1a85708ee64250eb40a1dfb4f70076d79336ee96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:15:55 +0800 Subject: [PATCH 12/12] docs: Auto Update Changelogs of v6.3.7 (#15873) * docs: Auto Generate Changelog of Release v6.3.7 * docs: changelog --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Status102 <102887808+status102@users.noreply.github.com> --- CHANGELOG.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b7143d5b7..95f8d14f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v6.3.6 +## v6.3.7 ### 拉电线不知天地为何物 | Highlight @@ -65,6 +65,27 @@ We warmly welcome community developers to assist with adaptation and submit impr 以下是详细内容: +## v6.3.7 + +### 改进 | Improved + +* 重构战斗中击杀识别, 击杀图标匹配使用高斯模糊预处理 (#15868) @status102 + +### 修复 | Fix + +* 自动战斗最右侧单位无法识别 @status102 +* 自动战斗击杀数识别便宜 @status102 +* correct_rect在x y负方向超限不完全的情况下, 校正后width height错误 @status102 + +### 文档 | Docs + +* 修族谱 (#15856) @JasonHuang79 +* Add dedicated "MAA GUI download and installation guide" (#15138) @JasonHuang79 @Rbqwow + +### 其他 | Other + +* 繁中服「墟」活動導航 (#15849) @momomochi987 + ## v6.3.6 ### 改进 | Improved