Presentation is loading. Please wait.

Presentation is loading. Please wait.

Noise Filtering & Edge Detection Jeremy Wyatt. Filtering Last time we saw that we could detect edges by calculating the intensity change (gradient) across.

Similar presentations


Presentation on theme: "Noise Filtering & Edge Detection Jeremy Wyatt. Filtering Last time we saw that we could detect edges by calculating the intensity change (gradient) across."— Presentation transcript:

1 Noise Filtering & Edge Detection Jeremy Wyatt

2 Filtering Last time we saw that we could detect edges by calculating the intensity change (gradient) across the image We saw that we could implement this using the idea of filtering 011345 002334 004635 000443 000352 000055 000043 01 -202 01

3 Linear filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 i+y j+x y+2 x+2 i j NB We count from the upper left,and in MATLAB we start at 1

4 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 0 i+y j+x y+2 x+2 i=2 j=2

5 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 0 i+y j+x y+2 x+2 i=2 j=2

6 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 1 i+y j+x y+2 x+2 i=2 j=2

7 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 1 i+y j+x y+2 x+2 i=2 j=2

8 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 1 i+y j+x y+2 x+2 i=2 j=2

9 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 5 i+y j+x y+2 x+2 i=2 j=2

10 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 5 i+y j+x y+2 x+2 i=2 j=2

11 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 5 i+y j+x y+2 x+2 i=2 j=2

12 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 i+y j+x y+2 x+2 i=2 j=2

13 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 14 i+y j+x y+2 x+2 i=2 j=3

14 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 14 4 i+y j+x y+2 x+2 i=2 j=4

15 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 14 43 i+y j+x y+2 x+2 i=2 j=5

16 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 14 43 10 i+y j+x y+2 x+2 i=3 j=2

17 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 9 14 43 10 16 i+y j+x y+2 x+2 i=3 j=3

18 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 91443 10163 i+y j+x y+2 x+2 i=3 j=4

19 Linear Filtering: the algorithm for i=2:image_height-1 for j=2:image_width-1 end 011345 002334 004635 000443 000352 000055 000043 01 -202 01 91443 10164-2 i+y j+x y+2 x+2 i=3 j=5

20 Noise filtering We can use convolution to remove noise as we mentioned, e.g. mean filter This is a linear filter The most widely used is Gaussian filtering 0.01.02.010.06.11.06.01.02.11.16.11.02.01.06.11.06.01 0.02.010

21 Effect of mean filtering Original3x3 filter5x5 filter

22 Horizontal Sobel operator Abs(G x ) Threshold=30 5x5 Mean Filter Horizontal Sobel operator Abs(G x ) Threshold=30

23 Effect of Gaussian filtering Original5x5 filterHorizontal Sobel Operator Abs(G x ) Threshold = 30

24 Sequenced filters We can replace a 2d Gaussian filter with 2, 1d Gaussian filters in sequence 0.003.0133.0219.01330.003.0133.0596.0983.0596.0133.0219.0983.1621.0983.0219.0133.0596.0983.0596.0133 0.003.0133.0219.01330.003.0545.2442.4026.2442.0545.2442.4026.2442.0545

25 Gaussian edge detection We can take the first derivative of the masks and then convolve with those Then we can combine the resulting images using the formula for magnitude However when thresholded we can see that this loses edge information How can we keep this?.1897.17410-.1741-.1897

26 Second order operators Thresholding the first derivative of the smoothed signal thickens the edges and also we lose some useful edges One solution is therefore to take the second derivative instead A basic second order mask is the Laplacian 010 1-41 010

27 Reading RC Jain, Chapter 4


Download ppt "Noise Filtering & Edge Detection Jeremy Wyatt. Filtering Last time we saw that we could detect edges by calculating the intensity change (gradient) across."

Similar presentations


Ads by Google