%%%%%%%%%%%%%%%%%
%%降采样
clear all
im={}; %创建字典保存读取的图片
dis=dir('F:\kaggle_data_zip\Sample\*.jpeg');%%找到所有需要进行预处理的图像
for i=:length(dis)
path=strcat('F:\kaggle_data_zip\Sample\',dis(i).name);
im{i}=imread(path);%%读取图像
for k=: %%分别对三个通道进行降采样
up_scale=; %%将采样系数设置为5
im_gnd{i}(:,:,k)=modcrop(im{i}(:,:,k),up_scale);
im_gnd{i}(:,:,k) = single(im_gnd{i}(:,:,k))/;
end
figure,imshow(im_gnd{i});%%%这时显示的是进行降采样后的rgb图像
end
%%%%%%%%%%%%%%%%%%%%%%%%%%
LL=im_gnd{};
B0 = imresize(LL(:,:,),[ ],'bilinear');
B1 = imresize(LL(:,:,),[ ],'bilinear');
B2 = imresize(LL(:,:,),[ ],'bilinear');
%%线性插值
%%%%%%%%%%%%%%%%%%%%%%%
im1(:,:,)=B0;&&&合并三个通道的图像
im1(:,:,)=B1;
im1(:,:,)=B2;
imshow(im1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=cutblack2(im_gnd{}(:,:,));%%调用cutblack函数,得到裁剪位置
B=cutblack(im_gnd{}(:,:,));
imshow(im_gnd{}(A():A(),B():B(),:)) %%裁剪RGB图像
%%%%%%%%%%%%%%%%%%%%%%%%%%%%