Filtering is just applying a mask to an image.Computer vision people call the linear form of these operations“convolutions”. They are actually “correlations,” since the true convolution inverts the mask.There aremany nonlinear filters, too, such as median filters and morphological filters.Filtering is the lowest level of image analysis and is taught heavily in image processing courses.

1.Images and Filters EE/CSE 576 Linda Shapiro

2.What is an image? 2

3.3

4.4 We sample the image to get a discrete set of pixels with quantized values. 2. For a gray tone image there is one band F( r,c ), with values usually between 0 and 255. 3. For a color image there are 3 bands R( r,c ), G( r,c ), B( r,c )

5.F ( ) = Image Operations (functions of functions) 5

6.F ( ) = Image Operations (functions of functions) 6

7.F ( ) = Image Operations (functions of functions) 0.1 0 0.8 0.9 0.9 0.9 0.2 0.4 0.3 0.6 0 0 0.1 0.5 0.9 0.9 0.2 0.4 0.3 0.6 0 0 0.1 0.9 0.9 0.2 0.4 0.3 0.6 0 0 0.1 0.5 7

8.F ( , ) = Image Operations (functions of functions) 8

9.Local image functions F ( ) = 9

10.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz Image filtering 1 1 1 1 1 1 1 1 1 10

11.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz 11

12.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz 12

13.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz 13

14.0 10 20 30 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz 14

15.0 10 20 30 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz ? 15

16.0 10 20 30 30 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz ? 16

17.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 20 10 0 20 40 60 60 60 40 20 0 30 60 90 90 90 60 30 0 30 50 80 80 90 60 30 0 30 50 80 80 90 60 30 0 20 30 50 50 60 40 20 10 20 30 30 30 30 20 10 10 10 10 0 0 0 0 0 Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz 17

18.What does it do? Replaces each pixel with an average of its neighborhood Achieve smoothing effect (remove sharp features) 1 1 1 1 1 1 1 1 1 Slide credit: David Lowe (UBC) Box Filter 18

19.Smoothing with box filter 19

20.Practice with linear filters 0 0 0 0 1 0 0 0 0 Original ? Source: D. Lowe 20

21.Practice with linear filters 0 0 0 0 1 0 0 0 0 Original Filtered (no change) Source: D. Lowe 21

22.Practice with linear filters 0 0 0 1 0 0 0 0 0 Original ? Source: D. Lowe 22

23.Practice with linear filters 0 0 0 1 0 0 0 0 0 Original Shifted left By 1 pixel Source: D. Lowe 23

24.Practice with linear filters Original 1 1 1 1 1 1 1 1 1 0 0 0 0 2 0 0 0 0 - ? Source: D. Lowe 24

25.Practice with linear filters Original 1 1 1 1 1 1 1 1 1 0 0 0 0 2 0 0 0 0 - Sharpening filter Accentuates differences with local average Source: D. Lowe 25

26.Sharpening Source: D. Lowe 26

27.Other filters -1 0 1 -2 0 2 -1 0 1 Vertical Edge (absolute value) Sobel 27

28.Other filters -1 -2 -1 0 0 0 1 2 1 Horizontal Edge (absolute value) Sobel 28

29.Basic gradient filters 0 0 0 1 0 -1 0 0 0 0 -1 0 0 0 0 0 1 0 1 0 -1 or Horizontal Gradient Vertical Gradient 1 0 -1 or 29