我已将几组图像(32x32)整理到另一个文件夹中。 我希望删除相同的图像,但像素值为 64x64。我已经编写了这段代码,但不知何故它在目录中找不到图像。如果你能说出我在这里做错了什么:
filtered_images = r'C:\Users\320067835\Desktop\Thesis\Data\png\Quality Check_sorted_images'
classes = ['Abdomen','Chest-Ap','Chest-Lat','CSpine-ap','CSpine-lat',
'elbow','Foot-AP','Foot-lat','Hand-AP','Hand-lat','Hand-obli',
'Hip-ap','Knee-AP', 'Knee-Lat', 'LSpine-ap-pa', 'LSpine-lat',
'Pelvis-AP' , 'Shoulder-AP', 'Shoulder-Axial', 'Skull-ap-pa',
'Skull-lat', 'TSpine-ap', 'TSpine-lat']
source_folder = r'C:\Users\320067835\Desktop\Thesis\Data\png\data_processed_cropped_64'
def sorted_images():
for a_class in classes:
source_path = os.path.join(source_folder,a_class)
a_class_num = classes.index(a_class)
for img in os.listdir(source_path):
if img in os.listdir(filtered_images):
continue
else:
shutil.move(img,r'C:\Users\320067835\Desktop\Thesis\Data\png\Quality check_64_64')
sorted_images()
错误:FileNotFoundError:[Errno 2] 没有这样的文件或目录:'Abdomen_0.png'