0% found this document useful (0 votes)
17 views20 pages

Module 2 Linear Filter Ppt

The document discusses image filtering techniques, emphasizing the importance of filters in enhancing images, extracting information, and detecting patterns. It covers various types of linear filters, such as Box, Gaussian, and Sobel filters, along with their properties and applications in image processing. Additionally, it explains convolution and correlation, as well as advanced concepts like band-pass and steerable filters for analyzing image features at different orientations.

Uploaded by

kkeerthi595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views20 pages

Module 2 Linear Filter Ppt

The document discusses image filtering techniques, emphasizing the importance of filters in enhancing images, extracting information, and detecting patterns. It covers various types of linear filters, such as Box, Gaussian, and Sobel filters, along with their properties and applications in image processing. Additionally, it explains convolution and correlation, as well as advanced concepts like band-pass and steerable filters for analyzing image features at different orientations.

Uploaded by

kkeerthi595
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Image Filtering

• Compute function of local neighborhood at each position of an image -perform a


specific mathematical operation or function on a defined set of pixels centered
around each position or pixel in an image
• If filter of size k*l and image of size m*n

• Filters are important as it


enhances images:-Denoise,Resize, increase contrast e.t.c
Extract information from images:-Texture,edges e.t.c
Detect patterns:-Template matching e.t.c
Linear Filter
• Linear filters are essential tools in computer vision for tasks such as image
processing, feature extraction, noise reduction, and more

• Some of the common types of filter are: Box Filter (or Averaging Filter),
Gaussian Filter, Median filter, Sobel Filter

• The choice of filter depends on the specific task and the characteristics of
the image being processed
Image:
[0 1 2 2 1]
[1 0 2 1 0]
[2 2 0 1 2]
[2 1 1 0 2] Filtered Image:
[1 0 2 2 0] [1 1 1 1 1]
Averaging Filter (3x3): [1 1 1 1 1]
[1 1 1 1 1]
[ 1/9 1/9 1/9 ]
[1 1 1 1 1]
[ 1/9 1/9 1/9 ] [1 1 1 1 1]
[ 1/9 1/9 1/9 ]
New pixel value = (0 * (1/9) + 1 * (1/9) + 2 * (1/9) + 1 * (1/9) + 0 * (1/9) + 2 * (1/9) + 2 * (1/9) + 1 * (1/9) + 0 * (1/9)) =
(10/9) = 1.11 (rounded to the nearest integer)
Key properties of Linear Filter
Linearity:
• The output of the filter is a linear combination of the input signal's values.
• Mathematically, if you have an input signal x[n] and a linear filter h[n], the
output y[n] is given by y[n] = x[n] * h[n], where * represents convolution.
• Also,
Shift Invariance:
• Shift the location of image and then apply a filter or apply a filter and then
shift

• Any linear, shift invariant operator can be represented as a convolution


Convolution and Correlation

Convolution use the flipped kernel to slide over the image or signal,
calculating the sum of element-wise products at each position

Correlation the kernel is not flipped before being slide over the input.
Used to calculate the similarity between the image
Use of Correlation For template matching
Handling Pixels close to the boundaries
Convolution properties

• Commutative property : a*b = b*a (signal and filter)


• Associative property: a*(b*c)=(a*b)*c (can apply successively any
filter one after the other)
note: Correlation is not assosiative
• Distributes over addition: a*(b*c)=(a*b)+(a*c)
• Scalar Factor: ka*b=a*kb
• Identity: a*e = a, where unit impulse[0,0,1,0,0] (multiply identity
function with any signal through convolution operation ,it will give
back the original signal)
Examples of Linear Filters

Box Filter

• The simplest filter to implement is the moving average or box filter which is
used as a method for reducing noise and removing small-scale details
from an image.
• It's widely used in various applications, such as image denoising, image
resizing, and preprocessing steps in computer vision and image analysis.
• The box filter operation is equivalent to convolving the image with a kernel
of all ones and then scaling the result by dividing it by the number of
elements in the kernel, which is K * K.
Bartlett Filter:
• A smoother image can be obtained by separably convolving the image with a
piecewise linear “tent” function (also known as a Bartlett filter).
• It is often used for smoothing or averaging values over a finite window or region.
• Here the convolution operation is performed in two separate steps: one in the
horizontal direction and another in the vertical direction.
• 3x3 version of the Bartlett filter is referred to as a "bilinear kernel as the bilinear
kernel is created by combining two linear functions in both the horizontal and
vertical directions.
• The Bartlett filter uses a rectangular or square-shaped kernel, where each
element typically has an equal weight. The kernel size can vary (e.g., 3x3, 5x5,
etc.), but the weights are uniform, resulting in simple averaging.
Sobel filter
• It's used to highlight edges in an image by calculating the gradient or change in
intensity across the image.
• The filter operates by convolving the image with a pair of 3x3 kernels.
• Horizontal Central Difference: This filter looks for changes in intensity levels from
left to right. It's like checking how quickly the brightness changes as you move
horizontally across the image.
• Vertical Tent Filter: This filter helps to smooth the results. It basically takes an
average of pixel values in a vertical direction, which reduces noise and makes the
result clearer.
• The central difference filter highlights areas where the brightness changes
significantly from left to right (indicating a vertical edge), and the tent filter smooths
out the result.
Gaussian Filter
• A Gaussian filter is a type of linear filter based on the Gaussian distribution
(also known as the normal distribution) and is particularly effective at
reducing high-frequency noise while preserving the overall structure of the
data.
• The filter is characterized by a bell-shaped curve, and it's often used to
create a softer or more visually pleasing appearance in images.
• The 1D Gaussian Filter is defines as
• G(x) is the value of the Gaussian function at position x
• σ (sigma) is the standard deviation, which controls the spread of the
Gaussian curve.
• To apply the Gaussian filter to a 2D image, you convolve the image with a
2D Gaussian kernel. The kernel is a discretized version of the Gaussian
function and is given by:

• G(x,y) is the value of the Gaussian kernel at position(x,y).


• σ is the standard deviation, controlling the spread of the kernel.
• x and y represent the spatial coordinates in the kernel.
Corner Detector:
• Method used to identify corners in an image. Corners are points where two
edges meet at a right angle, like the corners of a square.
• To identify corners, this detector looks for areas in the image where there
are rapid changes in intensity both horizontally and vertically.(Second
derivative)
• it may mistakenly detect points along diagonal lines as corners because
it's sensitive to changes in both horizontal and vertical directions.
• k" (or kernal, mask, or filter coefficients): This represents the matrix or array of values that
define the filter's weights or coefficients.
• k-square" (or kernel square): This often refers to the sum of the squares of all the values in the
filter kernel. Normalization ensures that the filter operation doesn't change the overall brightness or
intensity of the image.
Band-pass and steerable filters

• The Sobel and corner operators are simple examples of band-pass and oriented filters
• More sophisticated kernels can be created by first smoothing the image with a (unit area)
Gaussian filter, and then taking the first or second derivatives. Such filters are known
collectively as band-pass filters, since they filter out both low and high frequencies
We have gaussian filter,

• The second derivative of a two-dimensional image,

Bandpass filters are designed to pass a certain range of frequencies while blocking others.
Laplacian of Gaussian (LoG) filter is discussed as a bandpass filter.
• The Laplacian of Gaussian (LoG) filter is used for edge detection and feature
extraction. The formula for the LoG filter is given as:

• x and y are the spatial coordinates.


• σ is the standard deviation of the Gaussian filter, which controls the scale.
• G(x,y;σ) is the LoG filter's response.
• The LoG filter is obtained by first applying a Gaussian smoothing filter and then taking the
Laplacian operator, which enhances edges and features in the image while suppressing
noise.
Steerable Filters:
• A steerable filter, such as Gu, can be applied to the image in different orientations by
steering it using the unit vector u.
• By convolving the image with this steerable filter, you can effectively analyze the image
features at different angles without the need to create separate filters for each orientation.
• These filters are rotationally invariant and can be oriented in different directions by
multiplying them with a unit vector u=(u,v).
• The directional derivative ru is a derivative that measures the rate of change of an image f
in a specific direction given by the unit vector u. It is obtained by taking the dot product
between the gradient field r and the unit vector u:
• ru(G∗f)=r⋅u=ru(G∗f)
• G∗f represents the convolution of the image f with a filter G.
• r is the gradient field of the image.
• The formula for the steerable filter Gu is as follows:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy