Professional Documents
Culture Documents
Edge Detection Applications
Edge Detection Applications
regions.
a random number is generated between 1 and a final value. If the number is the
final value, then the pixel will be changed with noise. If the final number is larger,
fewer pixels will be changed. As the number decreases, more pixels will be
changed, thus making a noisier picture.
known as a structuring element (also known as a kernel). Dilation adds pixels to the
Gaussian Filter:
From the image perspective, during Gaussian filtering each individual pixel is replaced
with a Gaussian shaped blob with the same total weight as the original intensity value.
This Gaussian is also called the convolution kernel. It renders small structures invisible,
and smoothens sharp edges.
The Gaussian filter works by using the 2D distribution as a point-spread function. This is
achieved by convolving the 2D Gaussian distribution function with the image. We need
to produce a discrete approximation to the Gaussian function. This theoretically requires
an infinitely large convolution kernel, as the Gaussian distribution is non-zero
everywhere. Fortunately the distribution has approached very close to zero at about
three standard deviations from the mean. 99% of the distribution falls within 3 standard
deviations. This means we can normally limit the kernel size to contain only values 23
This means we can normally limit the kernel size to contain only values within three
standard deviations of the mean.
Median Filter:
Median filter is use to eliminate salt and paper noise Median filters are the most popular
because of the ability to reduce impulse noise aka salt-and-pepper noise. In order to perform
median filtering at a point of an image, we take a empty mask and we replicate the pixel of
image by its corner then we move mask around image
we first sort the values of the pixels in the neighborhood, determine the median and then
assign that value to the highest intensity corresponding pixel in the filtered image.
Sobel :
It computes an approximation of gradient of image. First order derivative
Demerit: signal to noise ratio
Not accurate results and discontinuity
Sobel X - vertical symmetric
Sobel Y - horizontal
When using Sobel Edge Detection, the image is processed in the X and Y directions
separately first, and then combined together to form a new image which
represents the sum of the X and Y edges of the image. However, these images can
be processed separately as well.
Then from there, we will use what is called kernel convolution. A kernel is a 3 x 3
matrix consisting of differently (or symmetrically) weighted indexes. This will
represent the filter that we will be implementing for an edge detection.
when we use the Y direction, we are scanning from top to bottom
When we want to scan across the X direction of an image for example, we will
want to use the following X Direction Kernel to scan for large changes in the
gradient. Similarly, when we want to scan across the Y direction of an image, we
could also use the following Y Direction Kernel to scan for large gradients as well.
The kernels applied to the input image, produce separate
together.
Laplacian Filter:
A Laplacian filter is one of edge detectors used to compute the
used to detect edges in an image. We will see how the filter finds
Laplacian didn’t take out edges in any particular direction but it took out edges in the
following classification.
● Inward Edges
● Outward Edges
This detector finds edges by looking for zero crossings after filtering f(x, y) with a
Laplacian of Gaussian filter. In this method, the Gaussian filtering is combined with
Laplacian to break down the image where the intensity varies to detect the edges
effectively. It finds the correct place of edges and testing wider area around the
pixel
Smoothing: Gaussian
Dilation:The dilation operator takes two pieces of data as inputs. The first is the
image which is to be dilated. The second is a (usually small) set of coordinate points
known as a structuring element (also known as a kernel). Dilation adds pixels to the
image. We want to identify all such pixel windows that are unique.
occurs in the pixel values. More formally, we take the sum squared
difference (SSD) of the pixel values before and after the shift and identify
pixel windows where the SSD is large for shifts in all 8 directions.
DOG:
One method is called "difference of gaussians" - you can imagine this corresponds to
taking a copy of a picture, blurring the copy slightly, and subtracting the original from
the copy to produce the result. Imagine a simple picture of a black rectangle on a
white background: the slight blurring has no noticeable effect in the middle of the
rectangle, because it mixes black pixels with black pixels, also in the background the
blurring has no effect as it mixes white pixels with adjacent white pixels - but it causes
the edges of the black region to "leak" outward. Now, when you subtract the original
image from the blurred copy, the centre of the blurred rectangle still matches the
centre of the sharp rectangle exactly, but the edges of the blurred rectangle are outside
the sharp rectangle, and they alone survive the subtraction, producing an image that
highlights the edges. "Gaussian" is a mathematical function used as the shape made by
High-level pseudocode
1. Take the grayscale of the original image
dupes of features)
descriptor.
You are exiting the script and thus the windows are closed. If you have multiple windows open and
you do not need those to be open, you can use cv2.destroyAllWindows() to close those all. Then you
can open new cv2 windows, if needed = in a sense in above cv2.destroyAllWindows() is just good
coding practice.
Low pass filter is the type of frequency domain filter that is used for smoothing
the image. It attenuates the high frequency components and preserves the low
frequency components. High pass filter: High pass filter is the type of frequency
domain filter that is used for sharpening the image.