def chooose_ims(batch_size):
global index
I1 = np.ndarray(shape=[1,256,256,1])
U1 = np.ndarray(shape=[1,256,256,1])
V1 = np.ndarray(shape=[1,256,256,1])
for i in range(batch_size):
if index>=len(files):
index=0
image = im.imread("/dataImages/dataset/"+files[index],mode='RGB')
image = image/255
I, U, V = imManipulation.rgb2yuv(image)
I = np.reshape(I, (1,256, 256,1))
U = np.reshape(U, (1,256, 256,1))
V = np.reshape(V, (1,256, 256,1))
I1 = np.concatenate((I1,I),axis=0)
U1 = np.concatenate((U1,U),axis=0)
V1 = np.concatenate((V1,V),axis=0)
index+=1
I1 = I1[1:,:,:,:]
U1 = U1[1:,:,:,:]
V1 = V1[1:,:,:,:]
return I1,U1,V1
评论列表
文章目录