运行顺序:-co-scale-brightness
c0.py:
import os
from PIL import Image
from PIL import ImageEnhance
import math
import numpy as np
imageDir="C:/flower_dealed_dataSet/prepare_pic/train/c0"
saveDir="C:/flower_dealed_dataSet/prepare_pic/newdata"
#水平翻转
def flip(root_path,img_name):
img = Image.open(os.path.join(root_path, img_name))
filp_img = img.transpose(Image.FLIP_LEFT_RIGHT)
return filp_img
#垂直翻转
def flip1(root_path,img_name):
img = Image.open(os.path.join(root_path, img_name))
filp_img = img.transpose(Image.FLIP_TOP_BOTTOM)
return filp_img
#随机裁剪
def randomCrop(root_path,image):
image = Image.open(os.path.join(root_path, image))
image_width = image.size[0]
image_height = image.size[1]
crop_image_width = math.ceil(image_width*