




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、2022-3-181第七章 Image Processing:Filtering In Spatial Domain2Image Processing:Filtering In Spatial Domain3頻域濾波頻域濾波:在傅立葉變換域的濾波運算空域濾波空域濾波:直接對圖像的像素進行的濾波運算 圖像增強圖像增強( Image enhancement ):處理一幅圖像使得結果比原圖像更適合于某種特定的應用 點運算、代數運算、幾何運算、濾波(空間域,頻率域)討論討論:濾波與其他圖像增強處理方法的主要差別是什么? 局部運算!Image Processing:Filtering In Spatia
2、l Domain4aasbbttysxftswyxg),(),(),(其中 a = (m - 1)/2 , b = (n - 1)/2 空域濾波是將鄰域內的圖像象素值同對應的與鄰域有相同維數的子圖像子圖像值相作用子圖像子圖像亦稱作:filter(濾波器)、 mask(掩模)、 kernel(核)、 template(模板)、 window(窗) 對33 掩膜,點 (x, y)處的響應為:R = w(-1,-1)f(x-1, y-1) + w(-1, 0)f(x-1, y) + .+ w(0,0)f(x, y) +.+ w(1,0)f(x+1, y) + w(1,1)f(x+1, y+1)對 m
3、n 濾波器掩膜討論討論:卷積與相關的差別對于濾波器尺寸m*n有什么限制?卷積與相關結果相同的條件是什么?Image Processing:Filtering In Spatial Domain5空間域濾波的機理Image Processing:Filtering In Spatial Domain6線性空間濾波器線性空間濾波器當濾波器是對稱的,濾波、卷積和相關是相同的。例如,低通低通濾波,高通高通濾波。. 討論討論:濾波、點運算、幾何運算的區別Image Processing:Filtering In Spatial Domain72. 非線性濾波器非線性濾波器中值濾波器中值濾波器aasbbt
4、tysxftswyxfyxw),(),(),(*),(aasbbttysxftswyxfyxw),(),(),(),(卷積(convolution)相關(correlation),(),(),(vuFvuWvuGImage Processing:Filtering In Spatial Domain8平滑濾波用于模糊圖像模糊圖像或減少噪聲減少噪聲。模糊模糊用于預處理步驟,如在對象提取前去除圖像中的小的細節,以及連接線或曲線中的小間斷減少噪聲減少噪聲可采用線性濾波,也可是非線性濾波,通過模糊化而完成 平滑線性濾波的輸出就是由濾波掩模所蓋住的鄰域內象素的平均平均。這些濾波器有時稱為平均濾波平均濾波
5、。也稱為低通低通濾波濾波。Image Processing:Filtering In Spatial Domain9對對mn 掩膜,第一個模板有一歸一化常數歸一化常數1/mn 第二個模板稱作加權平均加權平均模板bbtaasbbtaastswtysxftswyxg),(),(),(),(討論討論:為什么模板要除以不同的常數?對于平滑能力而言,哪個更好?Image Processing:Filtering In Spatial Domain10討論討論:為什么經平滑后黑白條換了位置?Image Processing:Filtering In Spatial Domain11)1)(1 (91),(
6、11nnmmnmzzzzzzH)cos21)(cos21 (91),(nmnmHnminimezez,. 0 ,32or when HnmNnMmnm/2,/2其中 MN 是圖像尺寸當 m=M/3 或 n=N/3時H = 0討論討論:頻率響應與圖像尺寸、濾波器尺寸有沒有關系?Image Processing:Filtering In Spatial Domain12主要目的主要目的: 突出圖像的細節,或者增強被模糊的細節。 一階導數一階導數 )() 1(xfxfxf 二階導數二階導數 )(2) 1() 1() 1()()() 1(22xfxfxfxfxfxfxfxf討論討論:可以寫成 f(x)
7、-f(x-1)? 或 f(x+1)-f(x-1)嗎嗎? Image Processing:Filtering In Spatial Domain13Image Processing:Filtering In Spatial Domain14 在圖像的一階導數一階導數運算中,一階導數一階導數通常產生較厚的邊緣。 一階導數一階導數對灰度階躍有較強的響應。 二階導數二階導數對細微結構有較強的響應,如細線和孤立點。 二階導數二階導數在灰度級階躍變化時產生雙響應。 二階導數二階導數對線的響應比對階躍的響應強,對點的響應比對線強。Image Processing:Filtering In Spatial
8、Domain15 各向同性濾波器:各向同性濾波器:其響應獨立于進行濾波的圖像中不連續的方向(即旋轉不變性)。 22222yfxff),(2), 1(), 1(222yxfyxfyxfxf),(2) 1,() 1,(222yxfyxfyxfyf2 (1, )(1, )( ,1)( ,1)4 ( , )ff xyf xyf x yf x yf x y方法展開方法展開:討論討論:什么是各向同性? 對于數字圖像,拉氏算子是完全各向同性的嗎?1 0 10 1 01 0 1 0 1 01 1 10 1 0 Image Processing:Filtering In Spatial Domain16討論討論
9、:對于拉氏算子,還有可以用其他模板嗎?Image Processing:Filtering In Spatial Domain17Image Processing:Filtering In Spatial Domain18Laplacian掩模的中心系數為負Laplacian掩模的中心系數為正),(),(),(),(),(22yxfyxfyxfyxfyxg簡化簡化:g(x, y) = f(x, y) f(x + 1, y) + f(x - 1, y)+f(x, y+1)+f(x, y-1)4f(x, y)=5f(x, y)f(x+1,y)+f(x-1, y) +f(x, y+1)+f(x, y
10、-1) 將原圖像與Laplacian圖像相加Laplacian算子圖像銳化算子圖像銳化Image Processing:Filtering In Spatial Domain19Image Processing:Filtering In Spatial Domain20),(),(),(yxfyxfyxfs其中 fs(x, y)表示由銳化掩模得到的銳化圖像 是f(x, y)的模糊版。 銳化掩膜銳化掩膜( unsharp masking) 高頻提升濾波高頻提升濾波 ),(),(),(yxfyxAfyxfhb其中 A=1, 方程可重寫為 ),(),(),() 1(),(yxfyxfyxfAyxfh
11、b),(),()1(),(yxfyxfAyxfshb),(yxfImage Processing:Filtering In Spatial Domain21),(),(),(),(22yxfyxAfyxfyxAffhb0-10-1A+4 -10-10-1-1-1-1A+8 -1-1-1-1如果采用 fs=g(x,y) (Laplacian圖像加上原圖像),(),(),(),(),(22yxfyxfyxfyxfyxgLaplacian掩模的中心系數為負Laplacian掩模的中心系數為正Image Processing:Filtering In Spatial Domain22Image Pro
12、cessing:Filtering In Spatial Domain23該矢量的幅度為 yfxfGGfyx2/1222/122)()()(yfxfGGfmagfyxyxGGfImage Processing:Filtering In Spatial Domain246859zzzzf)2()2()2()2(741963321987zzzzzzzzzzzzfRoberts 交叉梯度算子:Sobel 算子算子:討論討論:還可能有其他模板嗎?Image Processing:Filtering In Spatial Domain25討論討論:如采用Laplacian算子, 結果會是如何?Image
13、 Processing:Filtering In Spatial Domain26統計排序濾波器統計排序濾波器( Order-statistics filters ):):是非線性濾波器,其響應基于對濾波器所包圍的圖像區域內的象素進行排序,然后用排序結果值替代中心象素的值 中值濾波中值濾波(median filter):用某象素鄰域內象素灰度值的中值代替該象素灰度值(該像素原值包含在中值計算中) 脈沖噪聲脈沖噪聲(impulse noise):亦稱作散粒噪聲散粒噪聲(salt-and-pepper noise),在圖像上顯示為疊加在圖像上的黑白點Image Processing:Filteri
14、ng In Spatial Domain27J = IMNOISE(I,TYPE,.) 對灰度圖像加上特定類型(type)的噪聲 TYPE 是一個可取以下值的字符串: gaussian Gaussian white noise with constant mean and variance localvar Zero-mean Gaussian white noise with an intensity-dependent variance poisson Poisson noise salt & pepper On and Off pixels speckle Multiplicative
15、noiseImage Processing:Filtering In Spatial Domain28I = imread(eight.tif);figure;subplot(3,2,1);imshow(I);xlabel(a):Original Image)J = imnoise(I,gaussian,0,0.02);subplot(3,2,3);imshow(J);xlabel(b):Image with Gaussian noise)K = medfilt2(J);subplot(3,2,4);imshow(K);xlabel(c):Image after median filterin
16、g of (b)J = imnoise(I,salt & pepper, 0.05);subplot(3,2,5);imshow(J);xlabel(d):Image with salt & pepper noise)K = medfilt2(J);subplot(3,2,6);imshow(K);xlabel(e):Image after median filtering of (d)Image Processing:Filtering In Spatial Domain29對于NN的中值濾波器,其中N為奇數,輸出灰度值是在鄰域內大于等于(N2 1)/2或小于 等于(N2 1)/2個輸入象素
17、的灰度值。例:N=9,(10,20,20,20, 100, 15,20,20,25).這些值被排序如下:(10,15,20,20,20,20,20,25,100), 中值是 20.所以輸出是“ (10,20,20,20,20,15,20,20,25).最大濾波器:最大濾波器:用于找到圖像中的最亮點。),(max),(),(tsgyxfxySts),(min),(),(tsgyxfxySts最小濾波器:最小濾波器:Image Processing:Filtering In Spatial Domain30Image Processing:Filtering In Spatial Domain31
18、Examples:中值濾波的響應 (N=5)Slope Signal:斜升信號Single Pulse:單脈沖信號信號響應響應Step Signal:階躍信號Image Processing:Filtering In Spatial Domain32Three Pulse:三脈沖Triangle signal: 三角信號Double Pulse: 雙脈沖信號信號響應響應Image Processing:Filtering In Spatial Domain33中值濾波的特性:中值濾波的特性:n可有效降低散粒噪聲,效果比線性低通濾波器好,即在去噪的同時可保留邊緣。n小于中值濾波器一半區域的亮或暗
19、的對象可被去除n大于窗口一半區域的大對象被保留n有快速算法Image Processing:Filtering In Spatial Domain34討論討論:窗口尺寸、像素數、濾波性能間的關系。Image Processing:Filtering In Spatial Domain35Image Processing:Filtering In Spatial Domain36一個給定的增強任務需要應用幾個互補的增強技術以達到可接受的結果 1, 5 . 0,ccrs冪律(Power-law )變換:討論討論:冪率變換是個什么類型的運算?Image Processing:Filtering In
20、 Spatial Domain37Image Processing:Filtering In Spatial Domain38g = imfilter(f, w, filtering_mode, boundary_options, size_options)Image Processing:Filtering In Spatial Domain39Image Processing:Filtering In Spatial Domain401 2 3 45 6 7 8a b c de f g hsymmetriccircularreplicate15ae1 1 2 3 4Image Processing:Filtering In Spatial Domain41中值濾波中值濾波 g = medfilt2(f, m n, padopt) m n defines a neighborhood of size m n over which the median is computed. padopt may be zeros (the default), symmetric, or indexed.預定義預定義2-D線性空間濾波器線性空間濾波器w = fspecial(type, parameters)Image Processing:Filtering In Spa
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 影視設備智能穿戴設備集成考核試卷
- 石墨在微波吸收材料的研究考核試卷
- 森林保護與青少年素質教育考核試卷
- 生活的苦與樂初三語文作文
- 朋友初三語文作文
- 河南省洛陽市老城區三校聯考2023-2024學年八年級下學期7月期末考試數學試卷(含答案)
- 橋梁施工技術與質量控制考核試卷
- 紙質航空航天材料研發與性能評價考核試卷
- 玩具企業的產品線拓展與市場定位考核試卷
- 等離子體刻蝕設備的安全控制考核試卷
- 厥陰病完整版本
- 熒光-光譜完整版本
- 代持房屋合作協議書范本
- 供應鏈管理師技能競賽理論考試題及答案
- (新版)糖尿病知識競賽考試題庫300題(含答案)
- 新工人進場三級教育表格
- 全過程工程咨詢服務投標方案(技術方案)
- 寫字樓保潔人員培訓方案(技術方案)
- (附著式升降腳手架)設備設施風險分級管控清單
- 扶濟復新獲獎課件
- 外協救援服務協議
評論
0/150
提交評論