HW 2
HW 2
HW 2
2013717018
EE 576 PROJECT 2
1) a) Mean filter
The mean filter is a simple spatial and linear filter that replaces the center value in the
window with the average (mean) of all the pixel values in the window. The result is to reduce noise in
the image, but also to blur the edges (high frequency image detail) of the yacht. The bigger the
window the greater the noise reduction and blurring.
Syntax: boxFilter(input image, output image, int ddepth, size(9,9), Point anchor=Point(-1,-1),
bool normalize=true, BORDER_DEFAULT)
1)
smoothing is controlled by the choice of the standard deviation parameter sigma, not by the value of
the kernel size as in mean filter. The high spatial frequency content (sharp adges) of an image is
supressed in this filter so it can be called low-pass filter.
Syntax: GaussianBlur (Input image, Output image, Size (9,9) , double sigmaX, double
sigmaY=0,BORDER_DEFAULT)
Syntax: Sobel (Input image, Output Image, int ddepth, int dx, int dy, int ksize=3, double
scale=1, double delta=0, BORDER_DEFAULT )
In figure 5, we can see the original image and its edges. Before implementing Sobel operator,
we will use Gaussian filter due to noise in the original image. Such noise might otherwise elicit a large
response from the edge detector and dominate true edges in the image.
Figure 6: Edges on scene image with no filter and Gaussian filter (9x9)
The figure 6 shows edges in the scene images. In the left part, there is no Gaussian filter.
However, we know that derivative operators are sensitive to noise. When we use Gaussian before
detection, it is more effective to find true edges.
3) Morphological operators
In morphological operations, there are three concepts. Two of them are the image and
the type of morphological operation we are carrying out. The third factor is called the structuring
element and is a key element in any morphological operation. The structuring element is the entity
which determines exactly which image pixels surrounding the given foregound or background pixel
must be considered in order to make the decision to change its value or not. Structuring elements
have a designated centre pixel. In this project, structuring element is taken a rectangular of 5x5,
where all SEi,j = 1. (SE: Structuring element )
Syntax: morphologyEx(Input image, Output image, MORPH_GRADIENT, element,
Point(-1,-1), iteration );