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

perf: 优化仓库识别速度 #8113

Merged
merged 6 commits into from
Mar 1, 2024

Conversation

FreeSky-X
Copy link
Contributor

识别时间缩短到10多秒。芯片材料中的近卫和术士芯片太过相近可能会导致识别不全和不匹配。

@github-actions github-actions bot added ambiguous Issue cannot be understood by Issue-bot or PR does not comply with Commitizen. module: depot labels Jan 30, 2024
src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.h Outdated Show resolved Hide resolved
src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.cpp Outdated Show resolved Hide resolved
if (need_search) {
if (!serch_item(roi,get_match_begin_pos()-2))
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是应该单独开一个循环遍历 m_all_items_roi 然后记下序号, 防止找了一遍完全没找到的情况 (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果完全没找到是直接退出报错,还是再找一遍。现在找的条件是得分大于0.85,还不是找的最后一个,最后一个术士和近卫芯片会匹配上。后面的芯片匹配得分貌似都大于0.8(。这个地方有什么好的想法吗。。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

琢磨了一下,貌似能把上一页最后一个roi的内容临时存在一个Mat中,通过这个Mat来找。不知道能不能行,下午开服试试

Copy link
Contributor

@horror-proton horror-proton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 话说为啥 search_item 得分要求要尽量高, 我的理解是如果有假阳性那最多是多匹配了一些材料, 但是如果正确的材料没匹配到那就完全寄了. 不同人拥有的材料种类不同, 某一页的最后一个 (或者倒数第二个) 可能是任何材料

@FreeSky-X
Copy link
Contributor Author

🤔 话说为啥 search_item 得分要求要尽量高, 我的理解是如果有假阳性那最多是多匹配了一些材料, 但是如果正确的材料没匹配到那就完全寄了. 不同人拥有的材料种类不同, 某一页的最后一个 (或者倒数第二个) 可能是任何材料

目前的思路是按顺序匹配88种材料,定位上一页最后一个来确定当前页从哪个材料开始匹配。好处是匹配的次数少,坏处是定位不准炸了(

@github-actions github-actions bot removed the ambiguous Issue cannot be understood by Issue-bot or PR does not comply with Commitizen. label Feb 1, 2024
@status102 status102 changed the title 优化仓库识别速度 perf: 优化仓库识别速度 Feb 2, 2024
@horror-proton horror-proton merged commit 7df2060 into MaaAssistantArknights:dev Mar 1, 2024
11 checks passed
status102 added a commit that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants