Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter.

Similar presentations


Presentation on theme: "Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter."— Presentation transcript:

1 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 空間域中的 影像增強 mask, filter, kernel, template, window

2 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子

3 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 對比度增強的函數 (for all pixels on the target image)

4 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 基本灰階轉換函數

5 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 負片轉換

6 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 對數轉換

7 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 灰階切片 轉換函數

8 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子

9 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 乘冪轉換  < 1: 暗色擴張轉亮  > 1: 亮色擴張轉暗

10 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 乘冪轉換 (  < 1) 提高暗色對比 暗色轉成亮 原亮色壓縮 背椎骨折

11 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 乘冪轉換 (  < 1) 提高暗色對比 暗色轉成亮 原亮色壓縮 背椎骨折

12 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 乘冪轉換 (  > 1)

13 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子

14 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 機動轉換 增加 中段斜率 提高其對比 甚至變二值 花粉

15 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 直方圖等化 (Histogram equalization)

16 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 單調遞增函數

17 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain L= 100, N=10000 r = {r 0, r 1, r 2, r 3, r 4, r 5, …r 99 } = {0, 0.01, 0.02, 0.03, 0.04, 0.05, …0.99} n ={1500, 2000, 1500, 1000, 3000, 1000, 0…0} s= {0.15, 0.35, 0.5, 0.6, 0.9, 1, 1…1} |median| = 0.5 + s = T( r)

18 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain L= 256, N=10000 r = {r 0, r 1, r 2, r 3, r 4, r 5, …r 255 } = {0, 1, 2, 3, 4, 5, …255} / 256 n ={1500, 2000, 1500, 1000, 3000, 1000, 0…0} s= {0.15, 0.35, 0.5, 0.6, 0.9, 1, 1…1} x 256 | floor  {38, 89, 128, 153, 230, 256, …256} |median| = 128 + s = T( r)

19 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain L= 256, N=10000 r = {r 0, r 1, r 2, r 3, r 4, r 5, …r 255 } = {0, 1, 2, 3, 4, 5, …255} / 255 n ={1500, 2000, 1500, 1000, 3000, 1000, 0…0} s= {0.15, 0.35, 0.5, 0.6, 0.9, 1, 1…1} x 255 | floor  {38, 89, 127, 153, 229, 255, …255} |median| = 127 + s = T( r) 實作

20 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain s = T(r) Qu: 重複進行 H.E. 之效果如何 ? z = T 2 (s) =s? [hint] P s (s)=1 i.e. 均勻分佈

21 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 直方圖匹配 (Histogram Matching/ Specification) 修正直方圖分佈 機率函數為 P z (z) z = T 2 (r)= G -1 (T(r)) 想想 : r= T -1 (T(r))

22 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain

23 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 直方圖等化 ( 注意左側空段 )

24 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 直方圖匹配 (1)  (2) Note: (a) 為預想之分佈狀況 (d) 之分佈是否合於 (a)?

25 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 7x7 鄰域的 局部直方圖等化

26 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子

27 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 影像差值用於血管攝影

28 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 空間域的雜訊消除: 重複攝影之後取平均 (b) 模擬被破壞之一幅圖

29 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 重複攝影之後取平均 ( 與上頁圖 (a) 影像 作差值分析 )

30 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子

31 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 濾波遮罩 (filter mask)

32 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 濾波遮罩 (filter mask)

33 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 兩個 3x3 平滑濾波遮罩 for 平滑 ( 鈍化 ) smoothing (averaging) masks

34 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 平滑濾波

35 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 平滑濾波並取臨界值

36 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 使用 “ 平均遮罩 ” 與 “ 中值遮罩 ” 消除雜訊

37 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain ( 二階更適合突顯細節 ) f ’f ’’ Ramp 寬厚 區段 首尾 邊緣 Isolated Point 正反 突波 較強 響應 Thin Line 正反 區段 較強 響應 Step 較強 響應 正反 突波

38 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 拉普拉斯 ( 二階導數 ) 遮罩 for 銳化 ( 強化細節 )

39 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 拉普拉斯濾波、 視中心正負做加 減 (fig. 3.39) 、與 原始影像相加

40 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 複合拉普拉斯遮罩 ( 一次計算即可 ) 舉二例 e.g. 燒毀的 白熾燈泡 鎢絲

41 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 高增幅濾波, 其實就是加上一定比例的原圖

42 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain A=0 A=1 A=1.7

43 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 梯度遮罩 ( 一階導數 )

44 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 梯度遮罩,突顯 Ramp & Step 可放大不規則邊緣 (e.g. 隱形眼鏡 )

45 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 梯度遮罩 用於檢測

46 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Outline  單圖全幅增強  亮度轉換函數  Gamma 轉換的應用  直方圖等化  多圖全幅增強  差值突顯差異  平均消除雜訊  單圖局部增強  濾波遮罩  平滑、銳利、梯度 … 運算子  多圖及濾波合成

47 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain 複合影像 處理技術 Laplacian (a)+(b) (a)’s Sobel (b) (c) (d)

48 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain Avg of (d) i.e. (a)’s Sobel (c) x (e) (a) + (f) Power-law Enhancement of (g) (e) (f) (g) (h)

49 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain Chapter 4 Image Enhancement in the Frequency Domain Chapter 4 Image Enhancement in the Frequency Domain

50 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods 1D Frequency Domain

51 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods 8 x 8 2D DCT basis Discrete Fourier Transform (DFT) Discrete Cosine Transform (DCT) F(0,1)=? 2D Frequency Domain

52 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Discrete Fourier Transform (1)

53 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods 一個受損的積體電路 影像及其傅立葉頻譜 Discrete Fourier Transform (2)

54 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Lowerpass vs. Highpass Filters 低通濾波 v.s. 高通濾波

55 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Image Enhancement in the Frequency Domain Image Enhancement in the Frequency Domain 高通濾波並往上平移 增強 3/2 響應值

56 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration Chapter 4 Image Enhancement in the Frequency Domain Chapter 4 Image Enhancement in the Frequency Domain

57 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 影像重建模型

58 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration f(x,y)F(u,v) G(u,v)g(x,y) FT IFT (IDFT) (DFT) G(u,v) = F(u,v) H(u,v)

59 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 帶拒濾波器 (Bandregect filters, IBRF, BBRF, GBRF)

60 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration

61 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 帶通濾波器 (Bandpass filters) 所取得雜訊圖樣

62 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 特殊凹陷濾波器 (notch filters)

63 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 特殊凹陷 帶通 / 帶拒 濾波器 ( 一 ) 佛州 & 墨西哥灣

64 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 火星影像及其頻譜 特殊凹陷 帶通 / 帶拒 濾波器 ( 二 )

65 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Break 雜訊 ( 濾波器設計 ) 找一個有效的 H(u,v) 其他破壞 ( 反濾波器設計 ) 找出干擾的 H(u,v) 使用 1/H(u,v) 逆轉 f(x,y)F(u,v) G(u,v)g(x,y) FT IFT (IDFT) (DFT) G(u,v) = F(u,v) H(u,v) f(x,y)F(u,v) G(u,v)g(x,y) F(u,v) = G(u,v)/H(u,v) ^ ^ ^

66 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 大氣擾動

67 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 大氣擾動之反濾波 H(u,v) 在半徑 70 以外有 H =0 以除法將高頻部份予以放大

68 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration (a) 使用完整反濾波 (b) 限制半徑反濾波 (c) Wiener Filter (with K)

69 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 瞬時運動

70 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 5 Image Restoration Chapter 5 Image Restoration 左:瞬動破壞 中:完整反濾波 右: Wiener filter 上到下: 外加雜訊逐減

71 Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods End


Download ppt "Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter."

Similar presentations


Ads by Google