Sliding Window Filters. Longin Jan Latecki firstname.lastname@example.org October 9, 2002. Linear Image Filters Linear operations calculate the resulting value in the output image pixel f(i,j) as a linear combination of brightness in a local neighborhood of the pixel h(i,j) in the input image.
Longin Jan Latecki
October 9, 2002
Function w is called a convolution kernel or a filter mask. In our case it is a rectangle of size (2a+1)x(2b+1).
Compute the 2-D linear convolution of the following two signal X with mask w.
Extend the signal X with 0’s where needed.
Averaging of brightness values is a special case of discrete convolution. For a 3 x 3 neighborhood the convolution mask w is
The significance of the central pixel may be increased to better reflect properties of Gaussian noise:
The gradient direction gives the direction of maximal growth of the function, e.g., from black (f(i,j)=0) to white (f(i,j)=255).
The gradient magnitude and gradient direction are continuous image functions, where arg(x,y) is the angle (in radians) from the x-axis to the point (x,y).
Sometimes we are interested only in edge magnitudes without regard to their orientations.
The Laplacian is approximated in digital images by a convolution sum.
A digital image is discrete in nature, derivatives must be approximated by differences.
The value n should be chosen small enough to provide a good approximation to the derivative, but large enough to neglect unimportant changes in the image function.
II. Operators based on the zero crossings of the image function second derivative (e.g., Marr-Hildreth or Canny edge detector).
The primary disadvantage of the Roberts operator is its high sensitivity to noise, because very few pixels are used to approximate the gradient.
and direction as arctan (y / x).
Matlab example program is filterEx1.m
Median is an order filter, it uses order statistics.
Given an NxN window W(x,y) with pixel (x,y) being the
midpoint of W, the pixel intensity values of pixels in W
are ordered from smallest to the largest, as follow:
Median filter selects the middle value as the value of (x,y).
Implement in Matlab a linear filter for image smoothing (blurring)
and a nonlinear filters: median, opening, and closing.
Apply them to noise_1.gif, noise_2.gif in
and to one example image of your choice.
Compare the results.