图像处理
数组下标为正整数
[图像高度,宽度,通道数目] = size(imread())
img_0 = imread(['./Flickr1024/',img_list(idx_file).name]);
[a,b,c] = size(img_0(1:2,1:3,:));
fprintf('[%d %d %d\n]',a,b,c)
【2,3,3】所以1:2区间左闭右闭
for idx_file = 1:5%[]
fprintf('%d\n',idx_file)
end
1
2
3
4
5
img_lr_0 = imresize(img_hr_0, 1/scale, 'bicubic'); 【a,b,c】===>【a/scale,b/scale,c】
I = im2double(imread('d.jpg'));% [0,1] %https://blog.csdn.net/majinlei121/article/details/46573451 I = rgb2gray(I)#转换为灰度图像,ndims=2 I = imresize(I,[263,263]) imwrite(I,'dd.jpg')#保存图片 [M,N] = size(I); fprintf('ndims %d\n',ndims(I))#数组维度 fprintf('%d %d\n',M,N)