import operator import cv2 import mmcv import numpy as np import os path = r"C:\Users\63108\Desktop\mmsegmentation-master\data\DeepScene\annotation\train" file = os.listdir(path) for name in file: image = mmcv.imread(os.path.join(path, name)) h, w, c = image.shape for i in range(h): for j in range(w): a = [0, 0, 0] b = image[i, j] c = a == b c = c[0] & c[1] & c[2] if c: print(c) print(name)
python判断文件夹照片是否有某个像素点
最新推荐文章于 2023-06-14 16:42:24 发布