# Creating a stacked version of the image - original and distorted one x, y = [], [] for disease_name, training_files in oral_disease_file_names_dict.items(): for training_image in training_files: img = cv2.imread(training_image) scaled_orig_img = cv2.resize(img, (40, 30)) img_har = w2d(img, 'db1', 5) scaled_img_har = cv2.resize(img_har, (40, 30)) stacked_img = np.vstack((scaled_orig_img.reshape(40*30*3,1),scaled_orig_img.reshape(40*30*3,1))) x.append(stacked_img) y.append(class_dict[disease_name])