我想保存RGB图像中的单通道图像,当我拍摄一张图像时可以使用,但是当我拍摄多张图像时出现问题
from glob import glob
import os
import numpy as np
def load_data(path):
img_list = []
for img in glob(os.path.join(path,"*.jpeg")):
image = cv2.imread(img)
img_list.append(image)
return img_list
p = load_data(path)
path = 'F:/EyePac/eye/class/Train_1'
img_array = np.array(p)
rgb = img_array[1]
r = rgb_r.copy()
r[:,:,1]=0
r[:,:,2]=0