Reshuffling of pixels : Its histogram won’t change.
Point-wise processing unaffected
NO SPATIAL INFORMATION
Next We’ll talk about a special kind of operator, convolution (linear filtering)
Filtering creates new pixel with coordinates equal to the coordinates of the centre
of the neighborhood, and whose value is the result of the filtering operation
processed value for the current pixel depends on both itself and surrounding pixels)
Contrast enhancement
FEATURE EXTRACTION DEEP LEARNING
The convolution in CNN
We’ll talk about a special kind of operator, convolution (linear filtering)
Also called filter mask or filter kernel/template/window
: define mask size and operations performed directly on the pixels
Convolution/correlation
(equivalence??)
: these cannot be implemented in frequency domain
LPF
HPF
If the function by which the new grey value is calculated is a linear function
of all the grey values in the mask, then the filter is called a linear filter.
How does spatial filter work?
A neighborhood ( rectangle of different size-odd no)
and an operation on the neighborhood
Process a group of pixels rather than a single pixel
we create a new image whose pixels have grey values
calculated from the grey values under the mask,
noise removal, ( smoothing)
sharpening ( edge enhancement )
edge detection
the process of applying a linear filter is called convolution
For a mask of size mxn, we assume typically
that m = 2s + 1 and n = 2t + 1, where s and t
are nonnegative integers. All this is for masks of
odd sizes, with the smallest meaningful size
being 3x 3
Although it certainly is not a requirement,
working with odd-size masks is more intuitive
because they have an unambiguous center
point
x and y are varied so that each pixel in h visits every pixel in f Effects of different filters
.
The value in a filter subimage are referred as coefficients, not
pixels.
Square templates have the same properties along both image axes
Response is based on ordering or ranking the pixels in the neighbourhood
Box-filter
Smoothing Spatial Filters
Pixels are like their neighbors
• One of the simplest spatial filter is smoothing:
• Simply average of all the pixels in the neighborhood of a central value
• We get rid of lots of finer details and so useful for highlighting only the gross
details or features for thresholding .
• The effect of averaging is to reduce noise, this is its advantage. An associated
disadvantage is that averaging causes blurring which reduces detail in an image.
• smoothing leads to blurring and is used in preprocessing steps, such as removal
of small details from an image prior to object extraction and bridging of small
gaps in lines or curves
• smoothing also blurs all sharp edges that bear important information about the
image.
• reduces the “sharp” transitions in gray levels ( random noise and also edges)
• Removes sharp features
All weights must sum to one
Usually the filters are normalized so that the sum of the entries is one. This avoids amplitude bias
so that average gray levels are kept the same. For example, in an area of the image that has
constant gray levels, the filtered image will also have this same constant gray level. If the sum were
not one, then the gray level in a constant region would get multiplied by the sum of the pixels in
the mask. We need to keep the range of both the input and output images same.
do not replace computed values into the original image, but write to an output image
You need a second memory buffer (array) for this
The larger the mask, the more averaging, and hence the more
noise reduction we can obtain. On the other hand, larger masks
increase the blurring of edges and result in a filtered image of
lower resolution.
By smoothing the original image we get rid of lots of the finer detail
which leaves only the gross features for thresholding
Original Image Smoothed Image Thresholded Image
Sharpening spatial filters
• Highlights fine details (e.g. edges) in an image or enhances details
that have been blurred through errors or imperfect capturing devices
• Image blurring by averaging filter, so sharpening by operations that
invert the process of averaging : Averaging is equivalent to integration
and differentiation is its inverse, sharpening is through partial
derivatives
• smoothing also blurs all sharp edges that bear important information
about the image
• it is equivalent to the suppression of high frequencies in the Fourier
transform domain ( LPF)