




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、實 驗 報 告課程名稱 數(shù)字圖像處理導論 專業(yè)班級 _ 姓 名 _ 學 號 _ 電氣與信息學院和諧 勤奮 求是 創(chuàng)新16 / 17文檔可自由編輯打印實驗題目圖像復原實驗-空域濾波復原實驗室 DSP室&信號室實驗時間2015 年 10月 13 日 實驗類別 設計同組人數(shù)2成 績指導教師簽字:一實驗目的1. 掌握圖像濾波的基本定義及目的。2. 理解空間域濾波的基本原理及方法。3. 掌握進行圖像的空域濾波的方法。二實驗內(nèi)容1. 讀出eight.tif這幅圖像,給這幅圖像分別加入椒鹽噪聲和高斯噪聲后并與前一張圖顯示在同一圖像窗口中。2. 對加入噪聲圖像選用不同的平滑(低通)模板做運算,對比不同
2、模板所形成的效果,要求在同一窗口中顯示。3. 使用函數(shù)imfilter時,分別采用不同的填充方法(或邊界選項,如零填充、replicate、symmetric、circular)進行低通濾波,顯示處理后的圖像。4. 運用for循環(huán),將加有椒鹽噪聲的圖像進行10次,20次均值濾波,查看其特點,顯示均值處理后的圖像(提示:利用fspecial函數(shù)的average類型生成均值濾波器)。5. 對加入椒鹽噪聲的圖像分別采用均值濾波法,和中值濾波法對有噪聲的圖像做處理,要求在同一窗口中顯示結果。6. 自己設計平滑空間濾波器,并將其對噪聲圖像進行處理,顯示處理后的圖像。三實驗具體實現(xiàn)1. 讀出(自己選定.t
3、if)這幅圖像,給這幅圖像分別加入椒鹽噪聲和高斯噪聲后并與前一張圖顯示在同一圖像窗口中。I=imread('trees.tif');subplot(1,3,1)imshow(I);title(' Original Image ');J = imnoise(I,'salt & pepper',0.05); %noise density=0.05subplot(1,3,2)imshow(J);title(' salt & pepper ');K= imnoise(I,'gaussian',0.01,0.
4、01); subplot(1,3,3)imshow(K);title(' gaussian ') 2. 對加入噪聲圖像選用不同的平滑(低通)模板做運算,對比不同模板所形成的效果,要求在同一窗口中顯示。I=imread('moon.tif');H = fspecial('sobel');subplot(2,2,1)imshow(I);title(' Qriginal Image ');Sobel = imfilter(I,H,'replicate');subplot(2,2,2)imshow(Sobel);title
5、(' Sobel Image ')H = fspecial('laplacian',0.4);lap = imfilter(I,H,'replicate');subplot(2,2,3)imshow(lap);title(' Laplacian Image ')H = fspecial('gaussian',3 3,0.5);gaussian = imfilter(I,H,'replicate');subplot(2,2,4)imshow(gaussian);title(' Gaussian
6、 Image ')3. 使用函數(shù)imfilter時,分別采用不同的填充方法(或邊界選項,如零填充、replicate、symmetric、circular)進行低通濾波,顯示處理后的圖像。originalRGB = imread('trees.tif');subplot(3,2,1)imshow(originalRGB);title(' Qriginal Image ');h = fspecial('motion', 50, 45); %motion blurredfilteredRGB = imfilter(originalRGB, h
7、);subplot(3,2,2)imshow(filteredRGB);title(' Motion Blurred Image ');boundaryReplicateRGB = imfilter(originalRGB, h, 'replicate');subplot(3,2,3)imshow(boundaryReplicateRGB);title(' 0-Padding');boundary0RGB = imfilter(originalRGB, h, 0);subplot(3,2,4)imshow(boundary0RGB);title(
8、'Replicate');boundarysymmetricRGB = imfilter(originalRGB, h, 'symmetric');subplot(3,2,5)imshow(boundarysymmetricRGB);title(' Symmetric ');boundarycircularRGB = imfilter(originalRGB, h, 'circular');subplot(3,2,6)imshow(boundarycircularRGB);title(' Circular');4.
9、 運用for循環(huán),將加有椒鹽噪聲的圖像進行10次,20次均值濾波,查看其特點,顯示均值處理后的圖像(提示:利用fspecial函數(shù)的average類型生成均值濾波器)。I=imread('kids.tif');J = imnoise(I,'salt & pepper',0.05);subplot(1,3,1)imshow(J);title(' salt & pepper Noise');h=fspecial('average'); %Averaging FilteringJ1=imfilter(J,h);for i
10、=1:10J1=imfilter(J,h);subplot(1,3,2)imshow(J1);title(' 10 Averaging Filtering');endJ2=imfilter(J,h);for i=1:20J2=imfilter(J,h); subplot(1,3,3)imshow(J2);title(' 20 Averaging Filtering');end5. 對加入椒鹽噪聲的圖像分別采用均值濾波法,和中值濾波法對有噪聲的圖像做處理,要求在同一窗口中顯示結果。I=imread('trees.tif');J = imnoise(
11、I,'salt & pepper',0.05);subplot(1,3,1)imshow(J);title(' Original Image ');h=fspecial('average'); %Averaging FilteringJ1=imfilter(J,h);subplot(1,3,2)imshow(J1);title(' Averaging Filtering ');J2=medfilt2(J); %Median Filteringsubplot(1,3,3)imshow(J2);title(' Medi
12、an Filtering ');6. 自己設計平滑空間濾波器,并將其對噪聲圖像進行處理,顯示處理后的圖像。domain=0 0 8 0 0; 0 0 8 0 0; 8 8 8 8 8; 0 0 8 0 0; 0 0 8 0 0;I=imread('trees.tif');J = imnoise(I,'salt & pepper',0.05);subplot(1,2,1)imshow(J);title(' Original Image ');K1= ordfilt2(J,5,domain);subplot(1,2,2)imshow(
13、K1);title(' 5*5 Smoothing Fitered Image');附錄:可能用到的函數(shù)和參考結果*報告里不能用參考結果中的圖像1) 讀出eight.tif這幅圖像,給這幅圖像分別加入椒鹽噪聲和高斯噪聲后并與前一張圖顯示在同一圖像窗口中。 I=imread('cameraman.tif');subplot(1,3,1)imshow(I);title(' Qriginal Image ');J = imnoise(I,'salt & pepper',0.05); %noise density=0.05subp
14、lot(1,3,2)imshow(J);title(' salt & pepper ');K= imnoise(I,'gaussian',0.01,0.01); subplot(1,3,3)imshow(K);title(' gaussian '); 圖2.1 初始圖像及椒鹽噪聲圖像、高斯噪聲污染圖 2) 對加入噪聲圖像選用不同的平滑(低通)模板做運算,對比不同模板所形成的效果,要求在同一窗口中顯示。I=imread('trees.tif');H = fspecial('sobel');subplot(2,
15、2,1)imshow(I);title(' Qriginal Image ');Sobel = imfilter(I,H,'replicate');subplot(2,2,2)imshow(Sobel);title(' Sobel Image ')H = fspecial('laplacian',0.4);lap = imfilter(I,H,'replicate');subplot(2,2,3)imshow(lap);title(' Laplacian Image ')H = fspecial(&
16、#39;gaussian',3 3,0.5);gaussian = imfilter(I,H,'replicate');subplot(2,2,4)imshow(gaussian);title(' Gaussian Image ') 圖2.2 原圖像及各類低通濾波處理圖像 3) 使用函數(shù)imfilter時,分別采用不同的填充方法(或邊界選項,如零填充、replicate、symmetric、circular)進行低通濾波,顯示處理后的圖像。originalRGB = imread('sedemo_onion.png');subplot(3
17、,2,1)imshow(originalRGB);title(' Original Image ');h = fspecial('motion', 50, 45); %motion blurredfilteredRGB = imfilter(originalRGB, h);subplot(3,2,2)imshow(filteredRGB);title(' Motion Blurred Image ');boundaryReplicateRGB = imfilter(originalRGB, h, 'replicate');subp
18、lot(3,2,3)imshow(boundaryReplicateRGB);title(' 0-Padding');boundary0RGB = imfilter(originalRGB, h, 0);subplot(3,2,4)imshow(boundary0RGB);title('Replicate');boundarysymmetricRGB = imfilter(originalRGB, h, 'symmetric');subplot(3,2,5)imshow(boundarysymmetricRGB);title(' Symm
19、etric ');boundarycircularRGB = imfilter(originalRGB, h, 'circular');subplot(3,2,6)imshow(boundarycircularRGB);title(' Circular'); 圖2.3 原圖像及運動模糊圖像 圖2.4 函數(shù)imfilter各填充方式處理圖像 4) 運用for循環(huán),將加有椒鹽噪聲的圖像進行10次,20次均值濾波,查看其特點,顯示均值處理后的圖像。I=imread('kids.tif');J = imnoise(I,'salt &
20、; pepper',0.05);subplot(1,3,1)imshow(J);title(' salt & pepper Noise');h=fspecial('average'); %Averaging FilteringJ1=imfilter(J,h);for i=1:10J1=imfilter(J,h);subplot(1,3,2)imshow(J1);title(' 10 Averaging Filtering');endJ2=imfilter(J,h);for i=1:20J2=imfilter(J,h); subpl
21、ot(1,3,3)imshow(J2);title(' 20 Averaging Filtering');end 圖2.5 椒鹽噪聲污染圖像經(jīng)10次、20次均值濾波圖像 由圖2.5可得,20次濾波后的效果明顯好于10次濾波,但模糊程度也更強。5) 對加入椒鹽噪聲的圖像分別采用均值濾波法,和中值濾波法對有噪聲的圖像做處理,要求在同一窗口中顯示結果I=imread('kids.tif');J = imnoise(I,'salt & pepper',0.05);subplot(1,3,1)imshow(J);title(' Original Image ');h=fspecial('average'); %Averaging FilteringJ1=imfilter(J,h);subplot(1,3,2)imshow(J1);title('
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2030年即食蛋撻行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025-2030年按摩滾輪棒多檔位行業(yè)深度調(diào)研及發(fā)展戰(zhàn)略咨詢報告
- 2025年PE擠塑拉條項目可行性研究報告
- 2024-2027年中國通信電纜行業(yè)市場調(diào)查研究及投資戰(zhàn)略研究報告
- 二零二五年度教育科技產(chǎn)品銷售代理合同樣本
- 2025年度二手房買賣合同(含房屋權屬確認及法律效力)
- 2025年度園林綠化工程節(jié)能技術應用合同示范文本
- 2025年度吊籃設備租賃合同包含設備定期維護與保養(yǎng)計劃
- 2025年度個人教育培訓課程開發(fā)合同
- 未來十年金融科技的趨勢預測與應對
- 漸變方格模板
- 潛水作業(yè)指導書
- 感謝對手閱讀附答案
- 環(huán)境因素匯總識別及評價表(保衛(wèi)部 )
- GB/T 8012-2000鑄造錫鉛焊料
- 第一課 第一章 AutoCAD 2012概述入門
- GB/T 33880-2017熱等靜壓鋁硅合金板材
- 消防安全風險辨識清單
- 超市店長考核方案(實例)
- 2023年版勞動實踐河北科學技術出版社一年級下冊全冊教案
- 方案報審表(樣表)
評論
0/150
提交評論