filters l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Filters PowerPoint Presentation
Download Presentation
Filters

Loading in 2 Seconds...

play fullscreen
1 / 26

Filters - PowerPoint PPT Presentation


  • 242 Views
  • Uploaded on

Filters. A filter is something that attenuates or enhances particular frequencies Easiest to visualize in the frequency domain, where filtering is defined as multiplication:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Filters' - benoit


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
filters
Filters
  • A filter is something that attenuates or enhances particular frequencies
  • Easiest to visualize in the frequency domain, where filtering is defined as multiplication:
  • Here, F is the spectrum of the function, G is the spectrum of the filter, and H is the filtered function. Multiplication is point-wise

(c) 2002 University of Wisconsin, CS 559

qualitative filters
Qualitative Filters

Function: F

Filter: G

Result: H

Low-pass

=

High-pass

=

Band-pass

=

(c) 2002 University of Wisconsin, CS 559

low pass filtered image
Low-Pass Filtered Image

(c) 2002 University of Wisconsin, CS 559

high pass filtered image
High-Pass Filtered Image

(c) 2002 University of Wisconsin, CS 559

filtering in the spatial domain
Filtering in the Spatial Domain
  • Filtering the spatial domain is achieved by convolution
  • Qualitatively: Slide the filter to each position, x, then sum up the function multiplied by the filter at that position

(c) 2002 University of Wisconsin, CS 559

filtering images
Filtering Images
  • Work in the discrete spatial domain
  • Convert the filter into a matrix, the filter mask
  • Move the matrix over each point in the image, multiply the entries by the pixels below, then sum
    • eg 3x3 box filter
    • averages

(c) 2002 University of Wisconsin, CS 559

box filter
Box Filter
  • Box filters smooth by averaging neighbors
  • In frequency domain, keeps low frequencies and attenuates (reduces) high frequencies, so clearly a low-pass filter

Spatial: Box

Frequency: sinc

(c) 2002 University of Wisconsin, CS 559

box filter8
Box Filter

(c) 2002 University of Wisconsin, CS 559

filtering algorithm
Filtering Algorithm
  • If Iinput is the input image, and Ioutput is the output image, M is the filter mask and k is the mask size:
  • Care must taken at the boundary
    • Make the output image smaller
    • Extend the input image in some way

(c) 2002 University of Wisconsin, CS 559

bartlett filter
Bartlett Filter
  • Triangle shaped filter in spatial domain
  • In frequency domain, product of two box filters, so attenuates high frequencies more than a box

Spatial: Triangle (BoxBox)

Frequency: sinc2

(c) 2002 University of Wisconsin, CS 559

constructing masks 1d
Constructing Masks: 1D
  • Sample the filter function at matrix “pixels”
  • eg 2D Bartlett
  • Can go to edge of pixel or middle of next: results are slightly different

1

1

3

1

5

0

1

2

1

1

2

1

4

(c) 2002 University of Wisconsin, CS 559

constructing masks 2d
Constructing Masks: 2D
  • Multiply 2 1D masks together using outer product
  • M is 2D mask, m is 1D mask

0.2

0.6

0.2

0.2

0.04

0.12

0.04

0.6

0.12

0.36

0.12

0.2

0.04

0.12

0.04

(c) 2002 University of Wisconsin, CS 559

bartlett filter13
Bartlett Filter

(c) 2002 University of Wisconsin, CS 559

guassian filter
Guassian Filter
  • Attenuates high frequencies even further
  • In 2d, rotationally symmetric, so fewer artifacts

(c) 2002 University of Wisconsin, CS 559

gaussian filter
Gaussian Filter

(c) 2002 University of Wisconsin, CS 559

constructing gaussian mask
Constructing Gaussian Mask
  • Use the binomial coefficients
    • Central Limit Theorem (probability) says that with more samples, binomial converges to Gaussian

1

1

2

1

4

1

1

4

6

4

1

16

1

1

6

15

20

15

6

1

64

(c) 2002 University of Wisconsin, CS 559

high pass filters
High-Pass Filters
  • A high-pass filter can be obtained from a low-pass filter
    • If we subtract the smoothed image from the original, we must be subtracting out the low frequencies
    • What remains must contain only the high frequencies
  • High-pass masks come from matrix subtraction:
  • eg: 3x3 Bartlett

(c) 2002 University of Wisconsin, CS 559

high pass filter
High-Pass Filter

(c) 2002 University of Wisconsin, CS 559

edge enhancement
Edge Enhancement
  • High-pass filters give high values at edges, low values in constant regions
  • Adding high frequencies back into the image enhances edges
  • One approach:
    • Image = Image + [Image – smooth(Image)]

Low-pass

High-pass

(c) 2002 University of Wisconsin, CS 559

edge enhance filter
Edge-Enhance Filter

(c) 2002 University of Wisconsin, CS 559

edge enhancement21
Edge Enhancement

(c) 2002 University of Wisconsin, CS 559

fixing negative values
Fixing Negative Values
  • The negative values in high-pass filters can lead to negative image values
    • Most image formats don’t support this
  • Solutions:
    • Truncate: Chop off values below min or above max
    • Offset: Add a constant to move the min value to 0
    • Re-scale: Rescale the image values to fill the range (0,max)

(c) 2002 University of Wisconsin, CS 559

image warping
Image Warping
  • An image warp is a mapping from the points in one image to points in another
  • f tells us where in the new image to put the data from x in the old image
    • Simple example: Translating warp, f(x) = x+o, shifts an image

(c) 2002 University of Wisconsin, CS 559

reducing image size
Reducing Image Size
  • Warp function: f(x)=kx, k > 1
  • Problem: More than one input pixel maps to each output pixel
  • Solution: Filter down to smaller size
    • Apply the filter, but not at every pixel, only at desired output locations
    • eg: To get half image size, only apply filter at every second pixel

(c) 2002 University of Wisconsin, CS 559

2d reduction example bartlett
2D Reduction Example (Bartlett)

(c) 2002 University of Wisconsin, CS 559

ideal image size reduction
Ideal Image Size Reduction
  • Reconstruct original function using reconstruction filter
  • Resample at new resolution (lower frequency)
    • Clearly demonstrates that shrinking removes detail
  • Expensive, and not possible to do perfectly in the spatial domain

(c) 2002 University of Wisconsin, CS 559