consumer模块完成度95%,准备部署消费者端测试
This commit is contained in:
20
check_icons.py
Normal file
20
check_icons.py
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
import os
|
||||
|
||||
def check_icon_brightness(file_path):
|
||||
if not os.path.exists(file_path):
|
||||
return None
|
||||
img = cv2.imread(file_path, cv2.IMREAD_GRAYSCALE)
|
||||
if img is None:
|
||||
return None
|
||||
# 计算非透明区域的平均亮度
|
||||
return np.mean(img)
|
||||
|
||||
icon_dir = r'D:\companyproject\mall\pages\mall\consumer\icons'
|
||||
fav = os.path.join(icon_dir, 'favorite.png')
|
||||
fav_active = os.path.join(icon_dir, 'favorite-active.png')
|
||||
|
||||
print(f"favorite.png brightness: {check_icon_brightness(fav)}")
|
||||
print(f"favorite-active.png brightness: {check_icon_brightness(fav_active)}")
|
||||
Reference in New Issue
Block a user