import cv2
import os
import time
from tqdm import tqdm
img_path = './img-2022/'
img_save_path = './imgs-2022-test/'
if not os.path.exists(img_save_path):
os.makedirs(img_save_path)
imgs = os.listdir(img_path)
for i, img in tqdm(enumerate(imgs)):
image = cv2.imread(img_path+ img)
# 给图像指定区域涂色
x1, x2, y1, y2 = 0, 100, 0, 100
image[y1:y2, x1:x2] = (255, 255, 255) # opencv读取图片shape是(h,w,c)
cv2.imwrite(img_save_path+ img, image)