import glob
import shutil
from natsort import natsorted
if __name__ == '__main__':
# path=r'C:/2021-11\images-optional\48'
# files = glob.glob(path + "/*/*.jpg")
# print(len(files))
# exit(1)
import cv2
import os
import numpy as np
path = r"C:/2021-11\images-optional/"
files=glob.glob(path+"*.jpg")
files=natsorted(files)
dir_dict={}
exclude=[]
for index, file in enumerate(files):
if index in exclude:
continue
template = cv2.imread(file, 0)
temp_h,temp_w= template.shape[:2]
for i in range(index-30,index+30):
if i<0 or i>=len(files)-1:
continue
target = cv2.imread(files[i], 0)
if target is None:
continue
t_h, t_w = target.shape[:2]
thread &#
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jacke121/article/details/121314353
内容来源于网络,如有侵权,请联系作者删除!