Dr' Claude C' Chibelushi - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Dr' Claude C' Chibelushi

Description:

certain type of information is retained / emphasized while others are rejected ... Single-pass equivalent: convolve masks. 9/27/09. 42. Spatial-Domain Filters ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 31
Provided by: claudecch
Category:

less

Transcript and Presenter's Notes

Title: Dr' Claude C' Chibelushi


1
Fac. of Comp., Eng. Tech. Staffordshire
University
Image Processing, Computer Vision, and Pattern
Recognition
Spatial Domain Filters
Dr. Claude C. Chibelushi
2
Outline
  • Introduction
  • Filter pass band
  • Spatial domain filters
  • Convolution-based filters
  • Mode and median filters
  • Combination of convolution-based filters
  • Summary

3
Introduction
Rate of intensity change (i.e. intensity
gradient) gives information such as object
boundary, presence of noise, ...
4
Introduction
  • Filter transforms image such that
  • certain type of information is retained /
    emphasized while others are rejected / attenuated
  • based on rate of change of pixel values

5
Introduction
6
Introduction
  • Filtering can be done in
  • spatial domain
  • i.e. applied to image pixels directly
  • frequency domain
  • i.e. applied to representation of image as sum of
    cyclic patterns

7
Filter Pass Band
  • Filters let through or attenuate specific ranges
    of image details
  • e.g. slow/gradual or fast changes in pixel value
  • Hence the classification of filters into
  • low-pass filters
  • high-pass filters
  • and other types of filters
  • band-pass filters, band-reject filters,

8
Filter Pass Band
  • Low-pass filter
  • Attenuates fast changes in pixel value but lets
    through slow / gradual changes
  • Typical application noise removal
  • Tends to blur image

9
Filter Pass Band
  • High-pass filter
  • Attenuates slow / gradual changes in pixel value
    but lets through fast changes
  • Typical application edge enhancement
  • Tends to be sensitive to noise
  • Output values may be outside numerical range of
    pixel value
  • shifting and scaling may be required (see notes
    on contrast enhancement)

10
Spatial-Domain Filters
  • Spatial-domain filters are based on moving
    window techniques e.g.
  • convolution operation (e.g. Laplacian filter)
  • sorting operation (e.g. median filter)
  • pixel-counting operation (e.g. mode filter)

11
Spatial-Domain Filters
  • Moving window
  • window repeatedly shifted over image
  • calculations performed for each shift
  • only pixels within window are considered

12
Spatial-Domain Filters
  • Convolution
  • Many spatial-domain filters are based on
    convolution
  • Convolution uses a moving window
  • shift-multiply-add operation

13
Spatial-Domain Filters
32
Output value
(-1x9)
(-1x30)
(0x29)
(0x33)
(0x39)
(1x9)
(1x2)
32
window
  • Convolution (example)

14
Spatial-Domain Filters
  • Convolution
  • Shift-multiply-add operation
  • weighted sum of pixel values in neighbourhood
  • weights specified in mask (kernel, template, ...)
  • sum entered in output image at pixel location
    corresponding to mask anchor
  • mask shifted by one pixel
  • Note shift by more than 1 pixel is sometimes
    used (gives smaller output image)

15
Spatial-Domain Filters
  • Convolution
  • Mathematical notation

Output at image row i, column j
for each mask row
for each mask column
16
Spatial-Domain Filters
  • Convolution pseudo code
  • / at each image pixel /
  • for each image row // downward window shifts
  • for each image column // rightward window
    shifts
  • / in image window covered by mask /
  • for each mask row
  • for each mask column
  • update local cumulative weighted sum
  • Note use output buffer

17
Spatial-Domain Filters
  • Convolution
  • Warning
  • Example given earlier shows common implementation
    of convolution
  • but it actually uses formula for cross-correlation

18
Spatial-Domain Filters
  • Convolution-based filters
  • Low-pass filter masks

19
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter
  • change that corresponds to edge is measured using
    derivative
  • 1st order derivative has high magnitude at edge
  • gradient of image
  • 2nd order derivative has zero-crossing at edge
    (but higher sensitivity to noise)
  • Laplacian of image

20
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter

21
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter noise sensitivity of Laplacian

Zero-crossings of Laplacian
Original image
22
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter noise sensitivity of Laplacian
  • possible solution pre-filtering with Gaussian LPF

23
Spatial-Domain Filters
  • Convolution-based filters
  • Laplacian of Gaussian

24
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks
  • gradient of discrete function can be estimated
    using finite difference
  • e.g. gradient along x-axis
  • other approximations Roberts masks, Sobel masks,
    Prewitt masks

25
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks

For general use combine outputs of vertical and
horizontal edge filters
26
Spatial-Domain Filters
High-pass filtering (Sobel masks) note
directional sensitivity
27
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks

28
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks

29
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks
  • Laplacian of discrete function can be estimated
    using finite difference

30
Spatial-Domain Filters
  • Convolution-based filters
  • High-pass filter masks

Single mask detects vertical and horizontal edges
31
Spatial-Domain Filters
  • Mode and median filters
  • Some low-pass filters not based on convolution,
    e.g.
  • mode filter
  • output pixel value (at anchor) most common
    value in neighbourhood requires local histogram
  • median filter
  • output pixel value (at anchor) median value
    in neighbourhood requires sorting

32
Spatial-Domain Filters
  • Mode filter pseudo code
  • / at each image pixel /
  • for each image row // downward window shifts
  • for each image column // rightward window
    shifts
  • / in current image window /
  • for each window row
  • for each window column
  • update local histogram
  • put local mode in output buffer

33
Spatial-Domain Filters
  • Median filter pseudo code
  • / at each image pixel /
  • for each image row // downward window shifts
  • for each image column // rightward window
    shifts
  • / in current image window /
  • for each window row
  • for each window column
  • update local sort
  • put local median in output buffer

34
Spatial-Domain Filters
  • Mode and median filters
  • Less blurring of edges (compared to averaging
    filters)
  • Computational requirements may be high sorting
    in the median filter

35
Spatial-Domain Filters
36
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Several filtering passes may be applied to image
  • passes may be parallel or sequential
  • combined effect can be obtained by (one of
    following)
  • combining results of individual passes
  • combining masks into one single-pass mask

37
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Parallel passes
  • e.g. combination of output of directional edge
    detectors (e.g. Sobel edge detector)
  • each edge pixel considered as vector (with
    magnitude and direction)

38
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Parallel passes
  • e.g. addition of output images

Single-pass equivalent add mask coefficients
39
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Parallel passes
  • addition of output images (ctd.)
  • relevant property of convolution
  • distributivity with addition

40
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Parallel passes e.g. edge detection by
    substraction

Original image
-
Smoothed image (5x5 Gaussian mask)
Output values scaled by 4 and offset by 128
41
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Sequential passes

Single-pass equivalent convolve masks
42
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Sequential passes (ctd.)
  • relevant property of convolution
  • associativity

43
Spatial-Domain Filters
  • Combination of convolution-based filters
  • Sometimes beneficial to blur image prior to edge
    detection
  • e.g. in Canny edge detector

Increasing degree of blurring
44
Summary
  • Filters retain / reject image details based on
    rate of change of pixel values
  • classes low-pass filter, high-pass filter, ...
  • based on neighbourhood (window) operations
  • e.g. convolution, sorting, counting operations,
  • convolution-based filters use mask

45
Summary
  • Combination of convolution-based filters
  • parallel e.g. for addition of filtered images
  • add mask coefficients
  • sequential convolve masks
Write a Comment
User Comments (0)
About PowerShow.com