Presentation is loading. Please wait.

Presentation is loading. Please wait.

Filtering and Enhancing Images. Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)

Similar presentations


Presentation on theme: "Filtering and Enhancing Images. Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)"— Presentation transcript:

1 Filtering and Enhancing Images

2 Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)

3 Why? Improvement Improvement Low level feature detection Low level feature detection

4 Definitions Image enhancement = improve the detectability of important features Image enhancement = improve the detectability of important features –Noise reduction –Smoothing –Contrast enhancement –Edge detection

5 Noise reduction example

6 Contrast enhancement example

7

8

9 Definitions Image restoration = restore degraded image Image restoration = restore degraded image –Usually needs a model of degradation

10 Image restoration examples (deconvolution)

11 POINT OPERATIONS

12 Definitions Point operation = output pixel is determined only by the input pixel Point operation = output pixel is determined only by the input pixel –Out[x,y] = f(In[x,y]) Contrast stretching = point operator that uses a piecewise smooth function of the input gray value to enhance important details of the image. Contrast stretching = point operator that uses a piecewise smooth function of the input gray value to enhance important details of the image. What are some examples that we have already seen? What are some examples that we have already seen?

13 Examples of point operations: Threshold (demo) Threshold (demo) Invert (demo) Invert (demo) Out[x,y] = max – In[x,y] RGB  gray conversion RGB  gray conversion Gamma correction Gamma correction

14

15 Gamma correction example

16 NEIGHBORHOOD OPERATIONS

17 Image smoothing Neighborhood operations = require more than a single image point Neighborhood operations = require more than a single image point Box filter = smoothing via equally weighted rectangular neighborhood (mask) Box filter = smoothing via equally weighted rectangular neighborhood (mask)

18 Image smoothing Gaussian filter Gaussian filter

19 Lowpass (smoothing) filter example

20 Highpass filter example

21 Image smoothing Median filter (or more generally, order statistic or filter) Median filter (or more generally, order statistic or filter)

22 Median filter example

23 RECALL FROM A PREVIOUS DISCUSSION (HOLE AND OBJECT COUNTING)...

24 Masks

25 Mask = set of pixel positions and corresponding values called weights Mask = set of pixel positions and corresponding values called weights Mask origin = usually center Mask origin = usually center How? How? 1.Calculate sum of products Boundary Boundary 1.Replicate nearest pixel value 2.Use 0 2.Normalize or clamp (or an amplitude shift will occur) Applying masks to images

26 Derived from convolution: Derived from convolution: Discrete form is cross correlation: Discrete form is cross correlation: where f is the input image, h is the mask/filter kernel, and g is the output image result where f is the input image, h is the mask/filter kernel, and g is the output image result

27 Convolution See http://en.wikipedia.org/wiki/Convolution for some nice animations. See http://en.wikipedia.org/wiki/Convolution for some nice animations. http://en.wikipedia.org/wiki/Convolution

28

29 1*40+2*40+1*80+ 2*40+4*40+2*80+ 1*40+2*40+1*80 =800

30 1*40+2*80+1*80+ 2*40+4*80+2*80+ 1*40+2*80+1*80 =1120

31 But what about borders? When we are missing data at the edges, we typically do one of the following: When we are missing data at the edges, we typically do one of the following: 1.Copy to the missing value, the nearest neighboring value. 2.Use 0 for the missing value(s). (Regardless, it really doesn’t matter, but we need to consistently do something.)

32

33 1*40+2*40+1*40+ 2*40+4*40+2*40+ 1*40+2*40+1*40 =640 Method 1: copy nearest

34 The importance of normalizing or clamping the result. Otherwise, the values might get larger and larger (brighter and brighter) or go out of the original range, depending on the filter. Otherwise, the values might get larger and larger (brighter and brighter) or go out of the original range, depending on the filter.

35 1+2+1+ 2+4+2+ 1+2+1 =16 640/16

36 1 2 1 2 4 2 1 2 1


Download ppt "Filtering and Enhancing Images. Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)"

Similar presentations


Ads by Google