You are on page 1of 13

Image Filtering

Previously, image enhancement techniques were discussed that make use of the gray value at a single pixel. In general, filtering methods typically use a function defined over a neighborhood of points that surround a given pixel.

Image Enhancement

Image Filtering
Point Operators
Typically modify the gray value of a pixel using a function of the information contained at that pixel Examples?

Filter Operators
Typically modify the gray value of a pixel using a function of the information in a local neighborhood around the pixel smoothing edge detection nonlinear operators geometric warping and correction thresholding

Image Enhancement

Filtering: Definitions
An informal definition
Filtering is the process of replacing a pixel with a value based on some function of spatially proximate data.

Some other definitions:


Ballard & Brown Filtering is a generic name for techniques of changing image gray level to enhance the appearance of objects. Most often this means transformations that make the intensity discontinuities between regions more prominent. Digital Processing of Remotely Sensed Images Filtering is a class of basic image processing operations used in radiometric restoration and enhancement of images. A linear filter is a linear, space-invariant system that modifies the spatial frequency characteristics of an image.
3

Image Enhancement

Pointwise Filtering Examples


Pointwise Noise Removal
g(x,y) = f(x,y) + (x,y) assume (x,y) is uncorrelated with ((x,y)) = 0
1 M
M

Let g(x,y) =

g (x,y)
i

i=1

Then, E[g(x,y)] = f(x,y) Variance in g : 2g = 1/M* Problems? 1) Assumptions about noise model may not hold. 2) Image Registration is required
4

Image Enhancement

Pointwise Filtering Examples


Continued
Arithmatic Operators

Image Subtraction In(x,y) = g(x,y) - h(x,y) Image Addition In(x,y) = g(x,y) + h(x,y) Image Division In(x,y) = g(x,y)/h(x,y)

Image Enhancement

Image Smoothing
Averaging pixel values in a local neighborhood tends to suppress high-frequency events. 255

255

0
6

Image Enhancement

Convolution and Filtering


Underlying many image filtering techniques is the operation known as convolution. General idea: reduce filtering operation to the repeated application of a mask or kernel to the image
Kernel can be though of as a NxN image N is usually odd so that the Kernel has a center pixel.

In practice, the weights or values of the Kernel are pointwise multiplied with the image and then added together Resulting sum is divided (normalized) by the sum of the weights of the Kernel. Final result is the convolution value at the pixel centered on the Kernel.

Image Enhancement

Image Averaging as a Convolution


Image Data: I
1 10 15 11 9 19 14 13 9 19 13 18 18 84 79 23 20 21 27 89 92 92 87 45 66 94 89 95 102 101 88 93 0 -1

Mask: M

104 103 94 99

1 1 1 1 1 1 1 1 1
-1 0 1 1 1

100 99 91 94 87

S=

M(k,m)1

101 98

k=-1 m= -1

If(i,j) =

k=-1 m= -1

(i+k,j+m) *M(k,m)1

If = IM
8

Image Enhancement

Local Averaging Continued

21

1*51 + 1*21 + 1*14 + 1*8 + 1*9 + 1*19 + 1*19 + 1*22 + 1*27

1/9 = 21

1 1 1

1 1 1

1 1 1

51 21 14

9 19

9 19 22 27

Kernel is aligned with pixel in image, multiplicative sum is computed, normalized, and stored in result image. Process is repeated across image range. What happens when Kernel is near edge of input image?

Image Enhancement

Convolution
Convolution of two functions g and f
g(x) f() = f() g(x - ) where is known as the dummy variable of integration. Results in computing the area beneath the curve produced by all offsets of g with respect to f
Example: f(x) 1 g() .5 1 1

-1

-.5 0 fg

-1

-1

1.5

-1

10

Image Enhancement

Filtering and Image Frequency


Filtering techniques are typically modifying image frequency characteristics Example:
Enhance edges (accent high frequency) Remove Noise (attenuate high frequency) Smooth (attenuate high frequency, accent low frequency)

Observation: Convolution is a spatial operation on the image Images can be converted to their frequency component prior to filtering to facilitate direct manipulation of image frequency characteristics. We will discuss techniques to accomplish this next lecture.

11

Image Enhancement

Example: 3x3 Average,


once per color channel

Original

3x3 Average Filter

12

Image Enhancement

Example:
Multiple Filter Processing
Gaussian Blur

Threshold

13

You might also like