MATLAB对车轮图形进行邻域操作并着丰富多彩的颜色

close all;                  %关闭当前所有图形窗口,清空工作空间变量,清除工作空间所有变量
clear all;
clc;
I=imread('tire.tif');           %输入图像
I1=im2double(I);                %数值类型转换
f=@(x) min(x);
I2=colfilt(I1,[4 4],'sliding',f);    %按照滑动邻域方式 进行对图像进行最小值邻域操作
m=2;n=2;
f=@(x) ones(m*n,1)*min(x);                    %
I3=colfilt(I1,[m n],'distinct',f);
m=4;n=4;
f=@(x) ones(m*n,1)*min(x);
I4=colfilt(I1,[4 4],'distinct',f);
set(0,'defaultFigurePosition',[100,100,1000,500]);%修改图形图像位置的默认设置
set(0,'defaultFigureColor',[1 1 1])%修改图形背景颜色的设置
figure
subplot(131),imshow(I2);
subplot(132),imshow(I3);       %显示原图像和处理后图像
subplot(133),imshow(I4);
colormap parula

在这里插入图片描述

colormap turbo

在这里插入图片描述

colormap jet

在这里插入图片描述

colormap hsv

在这里插入图片描述

colormap hot

在这里插入图片描述

colormap cool

在这里插入图片描述

colormap spring

在这里插入图片描述

colormap summer

在这里插入图片描述

colormap autumn

在这里插入图片描述

colormap winter

在这里插入图片描述

colormap gray

在这里插入图片描述

colormap bone

在这里插入图片描述

colormap copper

在这里插入图片描述

colormap pink

在这里插入图片描述

colormap default

在这里插入图片描述
开发工具:MATLAB 2022b
微信Alt+A截屏工具

猜你喜欢

转载自blog.csdn.net/m0_38127487/article/details/131843625