Lecture
Recall that there are three types of low pass filters:
- Ideal
- Butterworth
- Gaussian
NOTE: Equations for each of these filters can be found on canvas.
Image Sharpening Using Highpass Frequency Filters
- Edges and rapid changes correspond to high frequencies.
The Laplacian in the Frequency Domain is the second derivative of an image $f(x, y)$
Unsharp Masking and High-boost Filtering
When K > 1, then High-boost filtering When K == 1, then unsharp masking
NOTE: Must remember the equation for high-boost filtering.
Morphological Image Processing
It refers to a set of image processing operations that process images based on shapes. Morphological operations apply a structuring element to an input image, which creates an output image of the same size.
Mathematical Morphology - In biology, it is the study of form and structure. In mathematical morphology, images are collection of sets.
Reflection and Translation in Morphology
- Translation - Basically sliding/shifting an element.
Erosion and Dilation
- Erosion - removing pixels on object boundaries.
- Dilation - adding pixels on object boundaries.
Applications for Erosion:
- Shrinking Objects
- Removing bridges and branches (bridges, as in, a line connecting an object; branches are lines sticking out from an object).
In MatLab, we can use erosion by using the function ‘imerode( Image, SE );’
For erosion, the set of 1’s indicated is the foreground (object) of an image.
For erosion…
- Fully Match - Structured Element (SE)’s values all match with values found in the image. = 1
- Partially Match - There are some matches but not all are matching. = 0
- No Match - No matching values. = 0
Applications for Dilation:
- Expanding Shapes
- Filling holes and gaps
In MatLab, we can use dilation by using the function '
For Dilation…
- Fully Match = 1
- Partially Match = 1
- No Match = 0
Complementation and Reflection
Closing and Opening
Reading
Summary
For image enhancement, there are two types of spatial filters:
- Smoothing (lowpass)
- Sharpening (highpass)
Smoothing consists of linear and non-liner (median) filters.
Linear filters have subset of filters, such as box filters and gaussian.
Smoothing = reduce sharp transitions in intensity; noise reduction; reduce aliasing; reduce false contouring
NOTE: for box filtering, for any nxn dimensional filter, you multiply 1/n to every value within that filter.
(1/3^2) * every value (9) in filter
Basically, perform the product of sums in an image with values of the box filter. Afterwards, multiply the coefficient (1/n^2) to the resulting product of sums. After that, replace the middle value of the image with that computated result.
MATLAB CODE:
Distadvantages of box filtering:
- blurs edges - important edge details are not preserved.
- equal weighting - nearby pixels are treated the same–less natural-looking images as a result.
- noise handling - not capable in reducing noise; could increase certain noise
- visual artifacts - can create unwanted visual effects
Lowpass Gaussian
Gaussian kernels are circularly symmetric and separable
Equation: $w(s, t) = G(s,t) = Ke^{\frac{s^2+t^2}{2\omega^2}}$
Nonlinear Order-Statistic Filters
It is based on ordering (ranking) of pixels in the region encompassed by the neighborhood.
Median Filter - replaces the value of center pixel by the median of intensity values defined in the neighborhood of that pixel. Basically get all values, order them from least to greatest. The median of the rank would be the value of the center pixel.
Advantages of Median Over Average Filters
- Outlier Resistance - Median ignores extremes; average is skewed
- Edge Preservation - Median maintains edges; average blurs
- Non-linear Flexibility - Median adapts to various noises; average does not
- Effective in Noise - Median recovers pixels in noise; average may fail.
Sharpening (Highpass) Spatial Filters
- Averaging (Smoothing) - image is less detailed and blurry by blending intensities (integration)
- Sharpening - details are clearer and more defined via highlighting edges and contrasts (differentiation). It highlights transitions in intensity.
First Derivative - highlights rapid changes in intensity (edges) $\frac$ Second Derivative - detects areas where intensity changes begin or end.
IMPORTANCE: derivatives identify features that contribute to perceived sharpness.