代码拉取完成,页面将自动刷新
from settings import PATH
import os
import sys
import cv2 as cv
import numpy as np
from tqdm import tqdm
bosskit_items = [
("kit_t1", os.path.join(PATH["sample_image_dir"], "kit_t1.png")),
("kit_t2", os.path.join(PATH["sample_image_dir"], "kit_t2.png")),
("kit_t3", os.path.join(PATH["sample_image_dir"], "kit_t3.png")),
("kit_t4", os.path.join(PATH["sample_image_dir"], "kit_t4.png"))
]
def bosskit_check(root_path):
res = [0, 0, 0, 0]
submit_image_dir_list = os.listdir(root_path)
threshold = 0.75
for submit_image_dir in tqdm(submit_image_dir_list):
try:
image_path = os.path.join(root_path, submit_image_dir, "boss_reward.png")
src_img = cv.imread(image_path)
# print(image_path)
for i, bosskit_item in enumerate(bosskit_items):
tpl_img = cv.imread(bosskit_item[1])
r = cv.matchTemplate(src_img, tpl_img, cv.TM_CCOEFF_NORMED)
loc = np.where(r > threshold)
if len(loc[0]) > 0:
res[i] += 1
break
except:
print(submit_image_dir)
return res
def main():
res = bosskit_check(PATH["submit_image_dir"])
print(res)
pos = [round(i / sum(res), 6) for i in res]
print(pos)
if __name__ == "__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。