Lecture 4 - Filters Flashcards
What is Image Enhancement?
Process an image so that the result will be more suitable than the original image for a specific application. (Suitableness is up to each application)
Why is Image Enchancement used?
Common reasons for enhancement include
- Make images easier to interpret for the human eye (Improving visual quality)
- Generate better input for other image processing techniques (Improving recognition accuracy)
What can Image Enchancement be done in?
Spatial Domain : (image plane)
- Techniques are based on direct manipulation of pixels in an image
Frequency Domain :
- Techniques are based on modifying the Fourier transform of an image
What are some Spatial Domain transformation
- Point operations
- Filter (Mask) operations
What is Point Operation?
- Point operation deals with pixel intensity values individually
- Enhancement at any point depends only on the image value at that point.
- The transformed output pixel value does not depend on any of the neighboring pixel value of the input image
- Point Operation Examples:
- Image Negative
- Contrast Stretching
- Thresholding
What are Image Negatives?
- Reversing the intensity levels of an image.
- Image negative is produced by subtracting each pixel from the maximum intensity value.
- e.g. for an 8-bit image, the max intensity value is 2^8– 1 = 255
- An image with gray level in the range - [0, L-1] where L = 2^n; n = 1, 2…
- Negative transformation : s = L – 1 – r
What are the application of Image Negatives?
Suitable for enhancing white or gray detail embedded in dark regions of an image.
What are Log Transformations?
- Log curve maps a narrow range of low gray level values in the input image into a wider range of output levels.
- s = c log(r + 1), where s is a constant and r is a pixel (+1 is because log(0) causes issues)
What is the application of Log Transformation?
Used to expand the values of dark pixels in an image while compressing the higher-level values.
What is Power-Law (Gamma) Transformation?
- Gamma correction function is used to correct image’s luminance.
- Power-law transformations: s=cr^gamma or s=c(r+ε)^gamma
- gamma symbol: gamma, gamma correction
- gamma <1 maps a narrow range of dark input values into a wider range of output values [increase brightness]
- gamma >1 maps a narrow range of bright input values into a wider range of output values [increase darkness]
What is an example of Power-Law (Gamma)?
A magnetic resonance image (MRI) of an upper thoracic human spine with a fracture dislocation and spinal cord impingement
What are some common Piecewise-Linear Transformation Functions?
- Contrast Stretching
- Gray-level Slicing
- Clipping
What is Contrast Stretching?
- It is the difference between the intensity values of darker and brighter pixels
- Contrast stretching expands the range of intensity levels in an image.
- Contrast stretching is done in three ways:
- Multiplying each input pixel intensity value with a constant scalar. - Example: s=2*r
- Using Histogram Equalization
- Applying a transform which makes dark portion darker by assigning slope of < 1 and bright portion brighter by assigning slope of > 1.
What is Gray-level Slicing?
- Highlighting a specific range of gray levels in an image
- Display a high value of all gray levels in the range of interest and a low value for all other gray levels
- (a) transformation highlights range [A,B] of gray level and reduces all others to a constant
- (b) transformation highlights range [A,B] but preserves all other levels
What is Clipping?
- This function truncates all intensities below the optional value Min to Min and all intensities above the optional value Max to Max.
- Clipping can be used to remove unwanted features, noise, or extraneous information from an image.
REFER TO SLIDES
What are Advantages and Disadvantages of Piecewise-Linear Transformation Functions
Advantage:
- The form of piecewise functions can be arbitrarily complex.
- A Practical Implementation of some important transformations can be formulated only as piecewise functions.
Disadvantage:
- Their specification requires considerably more user input.
What is Histogram Equalization?
- Stretch out the histogram to produce a more uniform distribution
- In a process called histogram equalization, this information is used to compute a contrast increasing intensity transformation function.
- Histogram equalization transforms the intensity values so that the histogram of the output image approximately matches the flat (uniform) histogram.
REFER TO SLIDES FOR EXAMPLES
What is the Normalised Histrogram Function?
- The normalized histogram function is the histogram function divided by the total number of the pixels of the image:
- It gives a measure of how likely is for a pixel to have a certain intensity. That is, it gives the probability of occurrence the intensity.
- The sum of the normalized histogram function over the range of all intensities is 1.
REFER TO SLIDES FOR EXAMPLE
What is Intensity Transformation Function?
- That is, we add the values of the normalized histogram function from 1 to k to find where the intensity will be mapped.
REFER TO SLIDE FOR EXAMPLE AND FORMULA
What is Spacial Domain Filtering?
- Capabilities of point operations are limited
- Filters: combine pixel’s value + values of neighbors
What cant Point Operations do?
Combining multiple pixels needed for certain operations:
- Enhance an image, e.g., denoise, Blurring, Sharpening.
- Extract information, e.g., texture, edges.
- Detect patterns, e.g., template matching.
What is Image Noise?
Noise in image , is any degradation in an image signal , caused by external disturbance while an image is being sent from one place to another place via satellite , wireless and network cable .
What are souces or Noise?
– Light Variations
– Camera Electronics
– Surface Reflectance
– Lens
What is Additive Noise and Multiplicative Noise?
– Additive noise: 𝑓 ̂(i,j) = f(i,j) + n(i,j)
– Multiplicative noise: 𝑓 ̂(i,j) = f(i,j) * n(i,j)
What is Salt and Peper Noise?
Salt and pepper noise: contains random occurrences of black and white pixels
What is Gaussian Noise?
Variations in intensity drawn from a Gaussian normal distribution
How do you remove Noise?
- Filtering: Use filters to remove noise
- Filters (masks) operate on a neighborhood of pixels.
- The sub-image is called a filter (or mask, kernel, template, window).
- The values in a filter sub-image are referred to as coefficients, rather than pixels.
What are example of Neighbourhood Operations?
- Min: Set the pixel value to the minimum in the neighborhood
- Max: Set the pixel value to the maximum in the neighborhood
- Average: Set the pixel value to the average of the neighborhoods
- Median: The median value of a set of numbers is the midpoint value in that set (e.g. from the set [1, 7, 15, 18, 24] 15 is the median). Sometimes the median works better than the average
What is Image Filtering used for?
- Remove noise
- Sharpen contrast
- Highlight contours
- Detect edges
Image filters - linear or nonlinear.
- Linear filters are also know as convolution filters
- Nonlinear operations such as median filter
What are properties of Linear Filters?
- Linearity: filter(f1 + f2) = filter(f1) + filter(f2)
- Shift invariance: same behavior regardless of pixel location.
- The value of the output depends on the pattern in the image neighborhood, not the position of the neighborhood
- filter(shift(f)) = shift(filter(f))
- Any linear, shift-invariant operator can be represented as a convolution
- Commutative: a * b = b * a
- Associative: a * (b * c) = (a * b) * c
- Often apply several filters one after another: (((a * b1) * b2) * b3)
- This is equivalent to applying one filter: a * (b1 * b2 * b3)
- Distributes over addition: a * (b + c) = (a * b) + (a * c)
- Scalars factor out: ka * b = a * kb = k (a * b)
- Identity: unit impulse e = [0, 0, 1, 0, 0], a * e = a
- Differentiation
What is Average Filtering?
One of the simplest spatial filtering operations we can perform is a smoothing operation (remove sharp features)
- Simply average all of the pixels in a neighborhood around a central value
- Especially useful in removing noise from images
- Also useful for highlighting gross detail
REFER TO SLIDES FOR EXAMPLE
What is a Weighted Smooothing Filter?
More effective smoothing filters can be generated by assigning different pixels in the neighborhood different weights in the averaging function
- Pixels closer to the central pixel are more important
- Reduce smoothing effect
- Often referred to as a weighted averaging
REFER TO SLIDES FOR EXAMPLES
What is a Gaussian Filter?
REFER TO SLIDES WITH FORMULA
What is Median Filters (non0linear)?
- A Median Filter operates over a window by selecting the median intensity in the window.
- No new pixel values introduced
- Removes spikes: good for impulse, salt & pepper noise
- It is not as efficient at averaging away regular Gaussian noise
REFER TO SLIDES FOR EXAMPLES
LINEAR FILTER EXAMPLES
REFER TO SLIDES FOR EXAMPLES
What are the properties of Gaussian Filter?
Linear filters
Remove “high-frequency” components from the image (low-pass filter)
– Images become more smooth
Convolution of a Gaussian with a Gaussian is another Gaussian
– So can smooth with small-width kernel, repeat, and get same result as larger-width kernel would have
– Convolving two times with Gaussian kernel of width 𝜎 is same as convolving once with kernel of width 𝜎sqrt(2)
Separable kernels
– Factors into product of two 1D Gaussians
FORMULA FOR GAUSSIAN FILTERS
REFER TO SLIDES (SHOWS 1D AND 2D)
How do you filter in the Spacial Domain?
REFER TO SLIDES
Low-pass filtering -> convolve the image with a box / Gaussian filter
High-pass filtering -> result equals 0, given a box filter/average filter
What is High_Boost Filtering?
Here we take the original image and boost the high frequency components.
Can think of HighPass = Original – LowPass. Thus
HighBoost = bOriginal – LowPass
= (b-1)Original + Original – LowPass
= (b-1)*Original + HighPass
b is the boosting factor.
When b=1, HighBoost = HighPass
What is Sub-sampling?
– to build an image pyramid, or
– simply to reduce the resolution for efficient storage, transmission, processing
What is Aliasing
1.Sample more often
2.Get rid of all frequencies that are greater than half the new sampling frequency (Nyquist frequency)
Disadvantage:
Will lose information, But it’s better than aliasing
How do you do Aliasing?
Apply a smoothing filter
What is the Image Pyramid?
- Key component of many high level computer vision tasks
- How to create an image pyramid?
- Represent each image as a layer
1. Convolve layer 𝑖 with a Gaussian filter
2. Subsample layer 𝑖 by a factor of two (remove all even-numbered rows and columns) to get layer 𝑖 + 1 - Repeat steps 1 and 2 until a stopping criteria is satisfied
What is Template Matching?
- Finding object of known shape and appearance in an image
To identify the object, we have to compare the template image against the source image by sliding it. - At each location, we find the matching score between the image and the template
- Sum of Squared Difference (SSD) in pixel values
- (Normalized) Correlation coefficient
- (Normalized) Cross-correlation