parent
0ddcb423a5
commit
e3073c75f4
|
@ -1 +1 @@
|
|||
{"definitions":{"1fbb6008-7112-46ce-b6aa-413648acc5e5":{"name":"InPurodyuusu.BoxExamTop","displayName":"考试场景 最上方排名区域","type":"hint-box","annotationId":"1fbb6008-7112-46ce-b6aa-413648acc5e5","useHintRect":false}},"annotations":[{"id":"1fbb6008-7112-46ce-b6aa-413648acc5e5","type":"rect","data":{"x1":5,"y1":2,"x2":712,"y2":55}}]}
|
||||
{"definitions":{"1fbb6008-7112-46ce-b6aa-413648acc5e5":{"name":"InPurodyuusu.BoxExamTop","displayName":"考试场景 最上方排名区域","type":"hint-box","annotationId":"1fbb6008-7112-46ce-b6aa-413648acc5e5","useHintRect":false},"621d24ca-ad72-4c10-a2a1-77b76dcff8f3":{"name":"InPurodyuusu.BoxCardLetter","displayName":"手牌类型字母区域","type":"hint-box","annotationId":"621d24ca-ad72-4c10-a2a1-77b76dcff8f3","useHintRect":false}},"annotations":[{"id":"1fbb6008-7112-46ce-b6aa-413648acc5e5","type":"rect","data":{"x1":5,"y1":2,"x2":712,"y2":55}},{"id":"621d24ca-ad72-4c10-a2a1-77b76dcff8f3","type":"rect","data":{"x1":6,"y1":1081,"x2":715,"y2":1100}}]}
|
|
@ -267,7 +267,8 @@ def handle_recommended_card(
|
|||
def skill_card_count(img: MatLike | None = None):
|
||||
"""获取当前持有的技能卡数量"""
|
||||
img = use_screenshot(img)
|
||||
img = crop(img, y1=0.83, y2=0.90)
|
||||
x, y, w, h = R.InPurodyuusu.BoxCardLetter
|
||||
img = img[y:y+h, x:x+w]
|
||||
count = image.raw().count(img, R.InPurodyuusu.A)
|
||||
count += image.raw().count(img, R.InPurodyuusu.M)
|
||||
count += image.raw().count(img, R.InPurodyuusu.T)
|
||||
|
@ -379,3 +380,8 @@ def detect_recommended_card(
|
|||
)
|
||||
})
|
||||
return filtered_results[0]
|
||||
|
||||
if __name__ == '__main__':
|
||||
import cv2
|
||||
img = cv2.imread(r'E:\GithubRepos\KotonesAutoAssistant.worktrees\dev\kotonebot-resource\sprites\jp\in_purodyuusu\produce_exam_1.png')
|
||||
print(skill_card_count(img))
|
Loading…
Reference in New Issue