Skip to content

Opt: using template matching for commission suffix recognition#5731

Open
guoh064 wants to merge 2 commits into
LmeSzinc:devfrom
guoh064:commission_count
Open

Opt: using template matching for commission suffix recognition#5731
guoh064 wants to merge 2 commits into
LmeSzinc:devfrom
guoh064:commission_count

Conversation

@guoh064

@guoh064 guoh064 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fix #5698

原理是扫描右上角数量作为主要判断依据,原始数个数方法作为备份回退。

附上测试log,扫描结果有三个running但实际只有两个,程序找了两个委托运行,应该是符合预期的。

result.log

@LmeSzinc

Copy link
Copy Markdown
Owner

裁切委托后缀的图片,互相进行模板匹配来去重,不再通过 suffix ocr

@LmeSzinc LmeSzinc added the bug / 缺陷 Something isn't working label Jun 17, 2026
@guoh064

guoh064 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

裁切委托后缀的图片,互相进行模板匹配来去重,不再通过 suffix ocr

如果只改日服的话那Commission.suffix要赋予什么值呢,因为现在别的服务器还是利用suffix来判断两个是否相等;
如果所有服务器都改的话是不是要把所有用suffixocr的部分都改成模板匹配?因为看上去Commission这个类只有一个覆盖整个区域的Button类的属性(button),如果只裁剪后缀的图片的话就得考虑是不是用load_color等办法加载self.button.image,然后比较的时候做图片的互相模板匹配?这样做可行吗?

@LmeSzinc

LmeSzinc commented Jun 18, 2026

Copy link
Copy Markdown
Owner

所有服务器都改
把裁切的后缀图片缓存到实例属性中,添加方法使用模板匹配比对两个 Commission 对象的后缀图片,在 __eq__() 中调用。在缓存后缀图片的时候额外计算一个简单的哈希,在 __str__() 使用(如果有后缀图片)来在日志中区分同名委托

@guoh064

This comment was marked as resolved.

@guoh064 guoh064 force-pushed the commission_count branch from 2b16233 to 7b4d5d5 Compare June 19, 2026 10:36
@guoh064 guoh064 changed the title Opt: use ocr to determine running commission counts Opt: using pHash and template matching for commission suffix recognition Jun 19, 2026
@guoh064

guoh064 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

改用pHash粗判+matchTemplate细判的方法了。

附上log:
result.txt

Comment thread module/commission/project.py Outdated
Comment thread module/commission/project.py Outdated
Comment thread module/commission/project.py Outdated
@guoh064

guoh064 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

已修改。到时候可能squash一下换个commit message什么的?方便review就没fixup。

log文件:
result.txt

@guoh064 guoh064 changed the title Opt: using pHash and template matching for commission suffix recognition Opt: using Hash and template matching for commission suffix recognition Jun 19, 2026
@guoh064 guoh064 changed the title Opt: using Hash and template matching for commission suffix recognition Opt: using template matching for commission suffix recognition Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug / 缺陷 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants