python--->>>挑选图片数据

from PIL import Image
import os
import  shutil
import cv2

Files_path_result = r"C:/Users/94048/Desktop/temp_candelete/20210103_03_08_2028_G90_00_07_00-00_08_00_result/"
Files_path_src= r"C:/Users/94048/Desktop/temp_candelete/20210103_03_08_2028_G90_00_07_00-00_08_00_src/"
keep_path=r"C:/Users/94048/Desktop/temp_candelete/keep_image/"
image_list = os.listdir(Files_path_result)
for image_name in image_list:
    image_path = os.path.join(Files_path_src, image_name)
    keep_path1=os.path.join(keep_path, image_name)
    img = Image.open(image_path)
    if img is None:
        continue
    #shutil.move(image_path, keep_path)
    img.save(keep_path1)

  

posted @ 2021-03-26 17:24  水木清扬  阅读(118)  评论(0)    收藏  举报