import numpy as np
import os
import cv2 as cv
label_dir = './png/'
label_process_dir = './label_process/'
for file in os.listdir(label_dir):
label = label_dir + file
if os.path.isfile(label):
print(file)
# 获得一张图片的所有种类的灰度值
label_array = cv.imread(label, 0)
class_image = np.unique(np.array(label_array))
print('class_image:', class_image)
for i in class_image:
if i in [255, 106, 0]: # 84, 111, 208,
pass
else:
print('error---------------------------------------------------------------')