import cv2
import os
# 读取函数,用来读取文件夹中的所有函数,输入参数是文件名
def read_directory(directory_name):
for filename in os.listdir(directory_name):
print(filename)
img = cv2.imread(directory_name + "/" + filename)
cv2.imshow(filename, img)
cv2.waitKey(0)
read_directory("F:\SoftwareLearning\GitHub\FaceRecognition-tensorflow-master\EigenFaces\edit_imgs")
Python 读取文件夹下的所有图片
最新推荐文章于 2024-07-25 11:29:07 发布