def test():
path_text_for = 'D171.png'
path_text_back ='D771.png'
# image forground/background
im_for = misc.imread(path_text_for)
im_back = misc.imread(path_text_back)
size = im_for.shape
s = size[0] # size of the image (squared matrix)
# number of images
nbr_ims = 10
train = True
# generating the images
data,data_labels = generate_brodatz_texture(nbr_ims, s, im_back, im_for)
if train: # train
sio.savemat('../data/train.mat', dict([('x_train', data), ('y_train', data_labels)]))
else: # test
sio.savemat('../data/test.mat', dict([('x_test', data), ('y_test', data_labels)]) )
评论列表
文章目录