数字图像处理-图像平滑和锐化变换处理_第1页
数字图像处理-图像平滑和锐化变换处理_第2页
数字图像处理-图像平滑和锐化变换处理_第3页
数字图像处理-图像平滑和锐化变换处理_第4页
数字图像处理-图像平滑和锐化变换处理_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

图像平滑和锐化变换处理图像平滑和锐化变换处理 一 实验内容和要求一 实验内容和要求 1 灰度变换 灰度拉伸 直方图均衡 伽马校正 log 变换等 2 空域平滑 box gauss 模板卷积 3 频域平滑 低通滤波器平滑 4 空域锐化 锐化模板锐化 5 频域锐化 高通滤波器锐化 二 实验软硬件环境二 实验软硬件环境 PC 机一台 MATLAB 软件 三实验编程及调试三实验编程及调试 1 灰度变换 灰度拉伸 直方图均衡 伽马校正 灰度变换 灰度拉伸 直方图均衡 伽马校正 log 变换等 变换等 灰度拉伸程序如下 I imread kids tif J imadjust I 0 2 0 4 subplot 2 2 1 imshow I subplot 2 2 2 imshow J subplot 2 2 3 imhist I subplot 2 2 4 imhist J 直方图均衡程序如下 I imread kids tif J histeq I Subplot 2 2 1 Imshow I Title 原图像 Subplot 2 2 2 Imshow J Title 直方图均衡化后的图像 Subplot 2 2 3 Imhist I 64 Title 原图像直方图 Subplot 2 2 4 Imhist J 64 Title 均衡变换后的直方图 伽马校正程序如下 A imread kids tif x 0 255 a 80 b 1 8 c 0 009 B b c double A a 1 y b c x a 1 subplot 3 2 1 imshow A subplot 3 2 2 imhist A subplot 3 2 3 imshow B subplot 3 2 4 imhist B subplot 3 2 6 plot x y log 变换程序如下 Image imread kids tif subplot 1 2 1 imshow Image Image log 1 double Image subplot 1 2 2 imshow Image 2 空域平滑 空域平滑 box gauss 模板卷积 模板卷积 A imread onion png B rgb2gray A figure subplot 3 2 1 imshow B title 原始图象 H imnoise B gaussian subplot 3 2 2 imshow H title 高斯噪声 Q imnoise B salt subplot 3 2 3 imshow Q title 椒盐噪声 M fspecial average 3 3 E imfilter Q M subplot 3 2 4 imshow E title 3 3 平均模板 N fspecial average 5 5 K imfilter Q N subplot 3 2 5 imshow K title 5 5 平均模板 Z fspecial average 7 7 J imfilter Q Z subplot 3 2 6 imshow J title 7 7 平均模板 3 频域平滑 低通滤波器平滑 频域平滑 低通滤波器平滑 频域低通滤波处理噪声的程序如下 f1 f2 freqspace 25 meshgrid Hd zeros 25 25 d sqrt f1 2 f2 2 0 5 0 5 为截止半径大小 Hd d 1 h fsamp2 Hd figure 1 freqz2 h 64 64 RGB imread onion png I rgb2gray RGB I1 imnoise I gaussian I2 imnoise I salt I3 imnoise I speckle J imfilter I h replicate J1 imfilter I1 h replicate J2 imfilter I2 h replicate J3 imfilter I3 h replicate figure 2 subplot 221 imshow J title 原图像滤波后 subplot 222 imshow J1 title 高斯污染图像滤波后 subplot 223 imshow J2 title 椒盐污染图像污染后 subplot 224 imshow J3 title 乘法污染图像滤波后 4 空域锐化 锐化模板锐化 空域锐化 锐化模板锐化 I imread onion png A RGB2gray I figure subplot 2 3 1 imshow A title 原图 hs fspecial sobel S imfilter A hs hp fspecial prewitt P imfilter A hs A double A 双精度型 H 0 1 0 1 4 1 0 1 0 拉普拉斯算子 J conv2 A H same K A J subplot 2 3 2 imshow K title 拉普拉斯锐化图像 B edge A roberts 0 1 subplot 2 3 3 imshow B title 罗伯特锐化图像 subplot 2 3 4 imshow S title sobel 算子锐化图像 subplot 2 3 5 imshow P title prewitt 算子锐化图像 5 频域锐化 高通滤波器锐化 频域锐化 高通滤波器锐化 A imread onion png B rgb2gray A figure subplot 131 imshow B title 原图 B double B B fftshift fft2 B E B M N size B k1 round M 2 k2 round N 2 D 50 for i 1 1 M for j 1 1 N juli sqrt i k1 2 j k2 2 K i j 1 exp 1 2 juli 2 1 D 2 E i j K i j E i j end end E ifft2 ifftshift E E uint8 real E subplot 132 imshow E title 高斯高通滤波器 四 实验结果及分析四 实验结果及分析 1 灰度变换 灰度拉伸 直方图均衡 伽马校正 log 变换等 灰度拉伸运行结果如下 直方图均衡运行结

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论