python 从文件夹读取图片

最近开始搞图片检索

* coding=utf-8 *

from math import sqrt
import cv2
import time
import os
import numpy as np
from scipy.stats.stats import pearsonr
import os
img_path= r’E:\code\pictures’
imgs = os.listdir(img_path)
imgs=np.array(imgs)
cv2.namedWindow(‘image’, cv2.WINDOW_AUTOSIZE)
for img in imgs:
img = cv2.imread(img, cv2.IMREAD_COLOR)
cv2.imshow(‘image’, img)
cv2.waitKey(0)
cv2.destroyAllWindows()

你可能感兴趣的:(python,opencv,计算机视觉)