Matlab 图像预处理
2023-11-11 12:20:48
%%%%%%%%%%%%%%%%%
%%降采样
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图像
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
最新文章
- json的场景应用与实战
- vim 基本使用
- 手机软件Toast无法显示提示信息
- git cherry-pick
- MySql链接字符串 各种程序连接大合集(包括asp.net,c#,等等)
- We Know What @You #Tag: Does the Dual Role Affect Hashtag Adoption-20160520
- 智能车学习(十八)——电机学习
- 制作便携版 FireFox 火狐浏览器
- maven之一——多模块项目构建
- Flipping Parentheses(CSU1542 线段树)
- K-means聚类
- sqoop 1.4.4-cdh5.1.2快速入门
- vim 模式基础操作
- spring security 学习笔记
- Vue+koa2开发一款全栈小程序(6.个人中心)
- Tensorflow object detection API ——环境搭建与测试
- Understanding Built-In User and Group Accounts in IIS 7
- github版本控制相关
- C++获取当前所有进程的完整路径
- ssh连接docker镜像ubuntu与debian