390 likes | 406 Views
Explore the concepts of neighborhood and point processing in image manipulation, including linear filters like convolution and correlation. Learn about smoothing filters, Fourier transforms, frequency domain filters, and edge sharpening techniques such as unsharp masking. Discover non-linear smoothing filters like maximum, minimum, median, and K-nearest neighbors. Experiment with region of interest processing using average, median filters, and unsharp masking on an image.
E N D
Chapter 5: Neighborhood Processing • Point processing: applies a function to each • pixel • Neighborhood processing: applies a function • to a neighborhood of each pixel
○ Neighborhood (mask) • -- can have different shapes and sizes
○ Mask + Function = Filter Input signal Output signal Filter
1D 2D
◎ Linear filter: linear combination of the gray values in the mask
○ Processing near image boundaries • Ignore the boundary • Pad with zeros • (c) Copy boundary ○ Values outside the range 0-255 • Clip values • Scale values
◎ Convolution 5-9
。 Discrete Case: e.g., A = 4, B = 5, A + B – 1 = 8, 7-11
* Convolution can be defined in terms of polynomial product Extend f, g to if f, g have different numbers of sample points Let Compute The coefficients of to form the result of convolution 7-27
。Example: Let The coefficients of form the convolution 7-13
Discrete: Compared with Linear filtering: 5-15
◎ Smoothing Filters ○Averaging filters Input 3X3 5X5 7X7
○ Gaussian filters (1-D): (2-D):
Averaging filters Gaussian filters
○ Separable filters e.g., Laplacian filter
n × n filter: • 2 (n × 1)filters:
Frequency domain filters Frequency filters applied to the Fourier transforms of images Spatial filters applied to images Fourier transform (frequency domain) Image (spatial domain)
Fourier Transform (FT) Fourier Transform of function f(x) Inverse Fourier Transform of F(u) Discrete FT 5-22
2-D Fourier Transform Fourier Transform of function f(x, y) Inverse Fourier Transform of F(u, v) Discrete FT 5-24
Frequency: a measure by which gray values change with distance
High pass filter • Frequency filters Spatialdomain Fouriertransform Frequency domain Low pass filter High frequency components, e.g., edges, noises Low frequency components, e.g., regions 5-26
High pass Fourier transform Input image Low pass
◎ Edge Sharpening or Enhancement • ○ Unsharp masking
。 Idea of unsharp masking (a) Edge (b) Blurred edge (a) – k × (b)
。 Perform using a filter 。 Alternatives (a) (b) The averaging filter can be replaced with any low pass filters
。 Example: (a) Original (b) Unsharp Masking
○ High-boost filter • high boost = k(original) – (low pass) • = k(original) – ((original) - (high pass) • = (k-1)(original) + (high pass) 。 Alternatives: (a) (k/(k-1))(original) + (1/(k-1))((low pass) (b) (k/(2k-1))(original) + ((1-k)/(2k-1))((low pass)
。 Example: (a) (k/(k-1))(original) + (1/(k-1))((low pass) (b) (k/(2k-1))(original) + ((1-k)/(2k-1))((low pass)
◎ Non-linear smoothing filters Maximum filter: : mask elements Minimum filter:
。 Median filter • 。 K-nearest neighbors (K-NN) • 。 Geometric mean filter • 。 Alpha-trimmed mean filter • i) Order elements • ii) Trim off m end elements • iii) Take mean
Homework: 1. Select an experimental image 2. Apply a 3 by 3 (a) average filter and (b) median filter to the image 3. Unsharp masking 38