This commit is contained in:
ClF3 2024-01-22 16:01:09 +08:00
parent 4aca699e13
commit 4fed55b427
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ from datetime import datetime
recent=[]
history=[]
width=720
height=100
height=50
red=(0x00,0x00,0xff)
orange=(0x00,0x66,0xff)
yellow=(0x00,0xcc,0xff)
@ -21,7 +21,7 @@ def update_history():
history.append(average)
def fill(img,pos,color):
for i in range(5):
for j in range(100):
for j in range(height):
img[j,i+5*pos,:]=[color[0]%256,color[1]%256,color[2]%256]
def update_graph():
img=np.ones([height,width,3],dtype=np.uint8)
@ -36,7 +36,7 @@ def update_graph():
fill(img,i,light_green)
else:
fill(img,i,green)
cv2.imwrite("image.bmp", img)
cv2.imwrite("image.png", img)