MATLAB实用源代码
图像读取及灰度变换Iimreadcamerama
tif读取图像subplot121imshowI输出图像title原始图像在原始图像中加标题subplot122imhistI输出原图直方图title原始图像直方图在原图直方图上加标题图像旋转Iimreadcamerama
tiffigureimshowItheta30KimrotateIthetaTryvaryi
gthea
glethetafigureimshowK边缘检测Iimreadcamerama
tifJ1edgeIsobelJ2edgeIprewittJ3edgeIlogsubplot141imshowIsubplot142imshowJ1subplot143imshowJ2subplot144imshowJ31图像反转MATLAB程序实现如下:Iimreadxia
bmpJdoubleIJJ2561图像反转线性变换Hui
t8Jsubplot121imshowIsubplot122imshowH2灰度线性变换MATLAB程序实现如下:Iimreadxia
bmpsubplot221imshowItitle原始图像axis5025050200axiso
显示坐标系I1rgb2grayIsubplot222imshowI1title灰度图像axis5025050200
faxiso
显示坐标系JimadjustI10105局部拉伸,把0105内的灰度拉伸为01subplot223imshowJtitle线性变换图像0105axis5025050200grido
显示网格线axiso
显示坐标系KimadjustI10307局部拉伸,把0307内的灰度拉伸为01subplot224imshowKtitle线性变换图像0307axis5025050200grido
显示网格线axiso
显示坐标系3非线性变换MATLAB程序实现如下:Iimreadxia
bmpI1rgb2grayIsubplot121imshowI1title灰度图像axis5025050200grido
显示网格线axiso
显示坐标系JdoubleI1J40logJ1Hui
t8Jsubplot122imshowHtitle对数变换图像axis5025050200grido
显示网格线axiso
显示坐标系4直方图均衡化MATLAB程序实现如下:Iimreadxia
bmpIrgb2grayIfiguresubplot221imshowIsubplot222imhistII1histeqIfiguresubplot221imshowI1subplot222
fimhistI15线性平滑滤波器用MATLAB实现领域平均法抑制噪声程序:Iimreadxia
bmpsubplot231imshowItitle原始图像Irgb2grayII1im
oiseIsaltpepper002subplot232imshowI1title添加椒盐噪声的图像k1filter2fspecialaverage3I1255进行33模板平滑滤波k2filter2fspecialaverage5I1255进行55模板平滑滤波k3filter2fspecialaverage7I1255进行77模板平滑滤波k4filter2fspecialaverage9I1255进行99模板平滑滤波subplot233imshowk1title33模板平滑滤波subplot234imshowk2title55模板平滑滤波subplot235imshowk3title77模板平滑滤波subplot236imshowk4title99模板平滑滤波6中值滤波器用MATLAB实现中r