- 博客(11)
- 收藏
- 关注
原创 (10)Python实现批量npy转mat
仅为学习交流,侵删!转载请注明出处!目录from scipy import ioimport osimport numpy as npfrom matplotlib import pyplot as pltfolder = r'E:\test'name = os.listdir(folder)for each_npy in name: path1 = str(folder) path2 = str(each_npy) path = path1+'\\'+path2
2020-11-25 19:48:50 945 3
原创 (9)matlab实现批量RGB转Gray图像
仅为学习交流,侵删!转载请注明出处!目录clc;clear;close all;file_path ='C:\Users\Desktop\test1';filepath_save='C:\Users\Desktop\test2';% 保存路径img_path_list=dir(strcat(file_path,''));%获取该文件夹中所有格式的图像 img_num = length(img_path_list);%获取图像总数量 for j = 3:img_num%逐一读取图像
2020-11-25 19:38:45 483
原创 (8)Python计算并显示差值图像
仅为学习交流,侵删!转载请注明出处!from PIL import Imageimport numpy as npimport cv2import numpy as npimport matplotlib.pyplot as pltimport matplotlibfrom mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axesimport matplotlib.patches as patchesfrom PIL i
2020-10-14 10:43:30 2198 1
原创 灰度图像用于深度学习的简单相关处理(目录)
仅为学习交流,侵删!转载请注明出处!matlab实现批量dicom转pngmatlab实现批量png转matPython实现批量jpg按序重命名Python实现npy转jpgPython实现批量mat转jpgPython批量计算PSNR、SSIM、MSEPython实现按比例划分数据集Python计算并显示差值图像...
2020-10-13 16:07:37 1058
转载 (7)Python实现按比例划分数据集
仅为学习交流,侵删!转载请注明出处!import osimport randomimport shutildef copyFile(fileDir): image_list = os.listdir(fileDir) # 获取图片的原始路径 image_number = len(image_list) train_number = int(image_number * train_rate) train_sample = random.sample(image_l
2020-10-13 15:19:31 2816 1
原创 (6)Python批量计算PSNR、SSIM、MSE
仅为学习交流,侵删!转载请注明出处!import osimport numpy as npfrom glob import globimport cv2from skimage.measure import compare_mse,compare_ssim,compare_psnrdef read_img(path): return cv2.imread(path,cv2.IMREAD_GRAYSCALE)def mse(tf_img1, tf_img2): return
2020-10-13 14:59:26 3248 6
原创 (5)Python实现批量mat转jpg
仅为学习交流,侵删!转载请注明出处!import cv2import scipy.io as scioimport numpy as npimport osfolder = r'F:/in/'path = os.listdir(folder)for each_mat in path: first_name, second_name = os.path.splitext(each_mat) each_mat = os.path.join(folder, each_mat)
2020-10-13 14:47:28 1425
原创 (4)Python实现npy转jpg
仅为学习交流,侵删!转载请注明出处!npy为三维(200,256,256):存储200张256x256的灰度图像import cv2import numpy as npdepth_dataset = np.load("E:/numpydata/test.npy")# print(depth_dataset.shape)#遍历for i in range(0,depth_dataset.shape[0]): img = depth_dataset[i,:,:] #保存在一个
2020-10-13 12:07:06 2644
原创 (3)Python实现批量jpg按序重命名
仅为学习交流,侵删!转载请注明出处!import os# 图片存放的路径path = "E:/renumber/"# 遍历更改num = 1for file in os.listdir(path): os.rename(os.path.join(path,file),os.path.join(path,'{}'.format(num))+".jpg") # 结果为1.jpg... # os.rename(os.path.join(path,file),os.path.join(pat
2020-10-13 11:49:42 367
转载 (2)matlab实现批量png转mat
仅为学习交流,侵删!转载请注明出处!clc;clear;close all;filepath = 'C:\Users\Desktop\in\'; %图片路径可以根据自己需要修改;ext='*.png';dis = dir([filepath ext]);names={dis.name};a=imread([filepath names{1}]);data=zeros(length(names),size(a,1),size(a,2));for k=1:length(names)
2020-10-13 11:24:23 1338
原创 (1)matlab实现批量dicom转png
matlab实现批量dicom转png仅为学习交流,侵删!转载请注明出处!clc;clear;close all;file_path ='C:\Users\Desktop\in';% dicom文件路径 filepath_save='C:\Users\Desktop\out';% png保存路径img_path_list=dir(strcat(file_path,''));%获取该文件夹中所有格式的图像 img_num = length(img_path_list);%获取图像总数量 f
2020-10-13 11:12:23 1068 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人