1 / 29

Mean and Median Filters

Mean and Median Filters. 指導教授:張顧耀 學生姓名:張志坤 學號: E9406011. Outline. Introduction Mean Filter Median Filter Summary Demo. Introduction. 影像濾波的定義. 主要分成兩種方式: 頻率域 (frequency domain) :由空間域影像透過 轉換 ( 如複利葉 , 小波 ) 而形成的影像表示空間

larue
Download Presentation

Mean and Median Filters

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mean and Median Filters 指導教授:張顧耀 學生姓名:張志坤 學號:E9406011

  2. Outline • Introduction • Mean Filter • Median Filter • Summary • Demo Mean and Median Filters

  3. Introduction • 影像濾波的定義 • 主要分成兩種方式: • 頻率域(frequency domain) :由空間域影像透過 轉換 (如複利葉, 小波) • 而形成的影像表示空間 • 空間域(spatial domain) :直接對影像上的 pixel value做處理 空間域的方程式表示 g(x,y) = T[ f(x,y) ] f(x,y) 是輸入的影像 g(x,y) 是經過處理的影像 T ->影像濾波的方法 Mean and Median Filters

  4. Introduction • 影像濾波的定義( 方程式 g(x,y) = T[ f(x,y) ] ) Original Original y y (x,y) (x,y) Image f(x,y) Image g(x,y) x x g(x,y) = T[ f(x,y) ] f(x,y) 是輸入的影像 g(x,y) 是經過處理的影像 T ->影像濾波的方法 Mean and Median Filters

  5. Outline • Introduction • Mean Filter • Median Filter • Summary • Demo Mean and Median Filters

  6. Mean Filter The Mean Filter is used to soften an image by averaging surrounding pixel values. Mean and Median Filters

  7. Original Original y y (x,y) (x,y) Image f(x,y) x Image g(x,y) x Mean Filter Grayscale 3x3 pixel window (x,y) Center pixel = ( 22 + 77 + 48 + 150 + 77 + 158 + 0 + 77 + 219 ) / 9= 92 Mean and Median Filters

  8. Mean Filter (a) 加入點雜訊的方形影像; (b) 點雜訊方形影像的輪廓圖; (c) 經平均值濾波後的影像; (d) 平均值濾波後的輪廓圖。 Mean and Median Filters

  9. Original y (x,y) Image f(x,y) x Mean Filter • 演算法 int x , y ; int a=(n-1)/2; int color(i) , color(x,y); for(int k=x-a ; k<=x+a ; k++) { for(int m=y-a ; m<=y+a ; m++) { color(x,y)+=color(k,m) } } color(i)=[color(x, y)/n*n); Mean and Median Filters

  10. Original y (x,y) Image f(x,y) x Mean Filter • ITK Header file included #include “itkMeanImageFilter.h” Using Typedef Itk::MeanImageFilter < InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New((); InputImageType::SizeType indexRadius; indexRadius[0] = 1; // radius along x 1-> 2D 2-> 3*5 indexRadius[1] = 1; // radius along y Rx * 2 + 1= 2 * 1 + 1 = 3 Rx 就是 x 方向的半徑, 1 代表中心點 Ry * 2 + 1 = 2 * 1 + 1 = 3Ry 就是y 方向的半徑, 1 代表中心點 Mean and Median Filters

  11. Mean Filter Mean Source Mean and Median Filters

  12. Mean Filter Source Mean Mean and Median Filters

  13. Outline • Introduction • Mean Filter • Median Filter • Summary • Demo Mean and Median Filters

  14. Median Filter The Median filter is used to remove noise from an image by replacing pixels with the middle pixel value selected from a certain window size. Mean and Median Filters

  15. Original Original y y (x,y) (x,y) Image f(x,y) x Image g(x,y) x Median Filter Grayscale 3x3 pixel window (x,y) 0, 22, 48, 77, [ 77 ], 77, 150, 158, 219 Mean and Median Filters

  16. Median Filter (a) 加入點雜訊的方形影像; (b) 點雜訊方形影像的輪廓圖; (c) 經中間值濾波後的影像; (d) 中間值濾波後的輪廓圖。 Mean and Median Filters

  17. Median Filter • 演算法 int x , y ; int z=0; int a=(n-1)/2; int color(i) ; int array[] = new int [nxn-1]; for(int k=x-a ; k<=x+a ; k++) { for(int m=y-a ; m<=y+a ; m++) { array [z]=color(k,m) z++; } } sort(array); color(i)=median(array []); Mean and Median Filters

  18. Original y (x,y) Image f(x,y) x Median Filter • ITK Header file included #include “itkMedianImageFilter.h” Using Typedef Itk::MedianImageFilter < InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New((); InputImageType::SizeType indexRadius; indexRadius[0] = 1; // radius along x 1-> 2D 2-> 3*5 indexRadius[1] = 1; // radius along y Mean and Median Filters

  19. Median Filter 3×3 median filtering Source Mean and Median Filters

  20. Median Filter Source 3×3 median filtering 9×9 median filtering Mean and Median Filters

  21. Outline • Introduction • Mean Filter • Median Filter • Summary • Demo Mean and Median Filters

  22. Summary • Mean filter and Median filter的比較 - 1 Mean and Median Filters

  23. Summary • Mean filter and Median filter的比較 - 2 Mean filter Median filter Mean and Median Filters

  24. Summary • Mean filter and Median filter的比較 - 3 (c) 平均值濾波輸出 Mean and Median Filters

  25. Outline • Introduction • Mean Filter • Median Filter • Summary • Demo Mean and Median Filters

  26. Demo Mean and Median Filters

  27. Demo Mean and Median Filters

  28. 參考文獻 • ItkSoftwareGuide.pdf • http://www.cee.hw.ac.uk/hipr/html/mean.html • http://www.ntut.edu.tw/~s9598008/homework1.htm • http://www.cc.ntut.edu.tw/~s8410010/hw1.htm • 連國珍,“數位影像處理”,儒林圖書公司(SIM 949)。 • http://140.128.102.71/東海大學影像視訊處理實驗室 Mean and Median Filters

  29. 報告結束 敬請指教 Mean and Median Filters

More Related