1 / 37

Mathematical Morphology & Voting Filters

Mathematical Morphology & Voting Filters. 姓名 : 陳慧敏 授課老師 : 張顧耀 教授 日期 :2007/6/12. outline. What is morphology? Dilation Erosion Mathematical Morphology Binary Filters Grayscale Filters Voting Filter Binary Median Filter Hole Filling Filter

eldonl
Download Presentation

Mathematical Morphology & Voting 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. Mathematical Morphology & Voting Filters 姓名:陳慧敏 授課老師:張顧耀 教授 日期:2007/6/12

  2. outline • What is morphology? • Dilation • Erosion • Mathematical Morphology • Binary Filters • Grayscale Filters • Voting Filter • Binary Median Filter • Hole Filling Filter • Iterative Hole Filling Filter

  3. What is morphology? • A range of methods that deal with (alter) structure and shape in images. • Dilation • Erosion => Fig.2.經過Dilation處理 Fig.1.原圖 => Fig.4.經過Erosion處理 Fig.3.原圖

  4. Structuring element • Structuring element • a small array of pixels, each pixel to 0 or 1. • Example:

  5. Dilation Fig.6.Structuring element Fig.5.原始影像

  6. Dilation Fig.7.做完Dilation結果

  7. Dilation Fig.8.原始影像 Fig.9.經過Dilation處理 Fig.10.Structuring element

  8. Erosion Fig.12.Structuring element Fig.11.原始影像

  9. Erosion Fig.13.做完Erosion結果

  10. Dilation & Erosion Dilation: Fig.14. Original, dilated by 3x3 square, dilated by 5x5 square Erosion: Fig.15. Original, dilated by 3x3 square, dilated by 5x5 square

  11. outline • What is morphology? • Dilation • Erosion • Mathematical Morphology • Binary Filters • Grayscale Filters • Voting Filter • Binary Median Filter • Hole Filling Filter • Iterative Hole Filling Filter

  12. Mathematical Morphology • Binary Filters • Header #include "itkBinaryBallStructuringElement.h" #include "itkBinaryErodeImageFilter.h" #include "itkBinaryDilateImageFilter.h"

  13. Mathematical Morphology • Structuring element 設定: structuringElementType structuringElement; structuringElement.SetRadius( 1 ); // 3x3 structuring element structuringElement.CreateStructuringElement(); binaryErode->SetKernel( structuringElement ); binaryDilate->SetKernel( structuringElement );

  14. Mathematical Morphology • Grayscale Filters • 觀念、寫法與Binary Filters大致相同 #include "itkBinaryErodeImageFilter.h" 修改 #include "itkGrayscaleErodeImageFilter.h"

  15. Input Image (DICOM) signed short unsigned char 型態轉換 binary Image type ? grayscale BinaryErodeImageFilter BinaryDilateImageFilter GrayscaleErodeImageFilter GrayscaleDilateImageFilter 設定 structuringElement 設定 structuringElement Binary threshold unsigned char signed short 型態轉換 Output image

  16. Mathematical Morphology Fig.16.Effect of erosion and dilation in a binary image.

  17. Mathematical Morphology Fig.17.Effect of erosion and dilation in a binary image. Radius =1

  18. Mathematical Morphology Fig.18.Effect of erosion and dilation in a grayscale image.

  19. Mathematical Morphology Fig.19.Effect of erosion and dilation in a grayscale image. Radius =1

  20. outline • What is morphology? • Dilation • Erosion • Mathematical Morphology • Binary Filters • Grayscale Filters • Voting Filter • Binary Median Filter • Hole Filling Filter • Iterative Hole Filling Filter

  21. Voting Filter • Counting the number of pixels in its neighborhood by applying a rule. • Binary Median Filter • Hole Filling Filter • Iterative Hole Filling Filter

  22. Binary Median Filter • Binary Median Filter • robust approach for noise reduction • optimize the execution of the filter 0 0 0 0 0 0 1 1 1 median

  23. Binary Median Filter • Header • #include "itkBinaryMedianImageFilter.h“ • indexRadius[0] = radiusX; // radius along x indexRadius[1] = radiusY; // radius along y filter->SetRadius( indexRadius );

  24. Binary Median Filter Radius of 2,2 Fig.21. Effect of the BinaryMedianImageFilter on a slice from a MRI

  25. Binary Median Filter Fig.23. Effect of the BinaryMedianImageFilter on a slice from a MRI Radius of 1,1

  26. Hole Filling Filter • Hole Filling Filter • smoothing contours • filling holes in binary images • Converting a background pixel into a foreground pixel by majority threshold. • if the number of foreground neighbors(pixel value=1) surpass the number of background neighbors (pixel value=0) by the majority value.

  27. Hole Filling Filter Example: Neighborhood size : 3x3 majority threshold: 2 If foreground neighbors(=1) (3x3-1)/2+majority = 6 then background pixelconverting into a foreground pixel 01

  28. Hole Filling Filter • Header #include "itkVotingBinaryHoleFillingImageFilter.h“ • 設定majority threshold • filter->SetMajorityThreshold( 2 );

  29. Hole Filling Filter Fig.25.Effect of the VotingBinaryHoleFillingImageFilter on a slice from a MRI, radius1 ,2and 3 respectively, majority threshold=2

  30. 原圖 Radius=1 Radius=2 Radius=3 Fig.26.Effect of the VotingBinaryHoleFillingImageFilter on a slice from a MRI, radius1 ,2and 3 respectively , majority threshold=1

  31. Iterative Hole Filling Filter • Iterative Hole Filling Filter • smoothing contours • filling holes in binary images • The filter can be used in an iterative way, by applying it repeatedly until no pixel changes.

  32. Iterative Hole Filling Filter • To decide maximum number of iterations that this filter should be run. #include "itkVotingBinaryIterativeHoleFillingImageFilter.h“; filter->SetMaximumNumberOfIterations(numberOfIterations );

  33. Iterative Hole Filling Filter Fig.27. Effect of 1, 10 and 20 iterations of the VotingBinaryIterativeHoleFillingImageFilter using a 3x3 window. majority threshold=2

  34. 5x5 window majority = 1 原圖 numberOfIterations=1 numberOfIterations=10 numberOfIterations=20

  35. Input Image (DICOM) 型態轉換 signed short unsigned char BinaryMedianImageFilter VotingBinaryHoleFillingImageFilter VotingBinaryIterativeHoleFillingImageFilter indexRadius[0] = radiusX; // radius along x indexRadius[1] = radiusY; // radius along y Filter ? IterativeHoleFilling Median 設定MajorityThreshold HoleFilling 型態轉換 設定MajorityThreshold 設定重複做的次數 Output image Binary threshold

  36. 參考文獻 • ItkSoftwareGuide • 林國祥老師 投影片 • 數位影像處理 繆紹綱 譯

  37. The end

More Related