You are on page 1of 5
. ital tering can be implemented either by box filters based on the concept of convolution, in he in the frequency domain. FT is @ image information from the frequency domain. and textures in an image image, the gray level of the pixel located at (x, y) is replaced by R. «The mask is then moved to the next pixel location in the image and the process is repeated. This continues until all pixel locations have been covered. % 2.5.1 Smoothing Spatial UQ. Write short notes on: Filters in Spatial Domain. (MU - Q. 6(c), May 2019, 5 Maris) Ug. Explsin smoothing and sharpening filters int spatial domain, What are the properties that these ! masks must satis? ' (eo Oe ' ' ' t ‘Smoothing Spatial Filters divided into two types: ‘Smoothing Linear Filters (a) Average Filter (b) Weighted Average Filter (c) Order-statistic filter 2, Smoothing Non-Linear Filters (a) Order -statistic Filter OO Ex. 2.3.1 : The following example shows the application of (Average Filter/Mean Filter «eAverage (or mean) filtering is a method of ‘smooth, Jmnges by reducing the amount of intensity varia, between neighbouring pixels. ge filter works by moving through the ima te 1g each valve withthe ave. = The averay pixel by pixel, replacin plu of neighbouring pixels, including itself «There are some potential problems = 1. A single pixel with a very unrepresentative value cay significantly affect the average value ofall the pixels, its neighbourhood. When the filter neighborhood straddles an edge, ty filter will interpolate new values for pixels on the ede and so will blur that edge. This may be a problem if sharp edges are required in the output. ‘= Examples based on average filter an average filter to a simple one dimensional signal © soin. + ‘A window size of three is used, with one enxy immediately preceding and following each entry and following each entry. In this below example, because there is no entry preceding the first value, the first value is repeated (asi the Jast valve) to obtain enough entries to fill the window a]o]a]s2]3[s}o|2|2]9 yl] = round((3 +3 +9)/3)=5 (First value is repeated border value i.e. 3) y(2) = round(3 +9+4)/3)=5 YL] = round((9 +4 +52)/3)=22 y (4) = round((4 +52+3)/3)=20 y(5] = round((52+3+8)/3)=21 y(6] = round((3 +8 +6)/3)=6 ¥{7] = round((8 +64 2)/3)=5 ¥(8] = round((6+2+42)/3)=3 (MU-New Syllabus we.f academic year 21-22) (M6-108) Tech-Neo Publications... SACHIN SHAH Ventut rw ete Image Processing (MU - Sem 6 - IT) y(9] = round((2+2+9)/3)=4 y [10] = round((2 +9 +9)/3)=7 (Last value is be! repeated border value i.e. 9) The output signal is given below: For 2D image Average filter Mask is: Fig, Ex. 23.2 sa (II) Welghted Average Filter Ts seca mask is Hite more interesting, This mask yields so-called welghted average, terminology wed to rete ran we multiplied by different coeficients, thus giving more importance (weight) to some pixels at the expense of others, ‘© Inthe mask the pixel atthe center ofthe mask is mult , i ‘mask is multiptied by a higher value than any other, thus giving this pixel more importance in the calculation ofthe average, eles baa er yatne an 20 giving ‘Weighted Filter mask is as follows: 5 MATLAB Code ‘% Read Image for Noise Addition img=imreed(lena.bmp): % Add Noise Noi_img = imnoise(img,salt & pepper’ 0.02): 4 Mask Definition feVlo*(1 23 % Apply filter2 function de_noi=filter2({,Noi_img): figure; subplot(1,3,1)simshow img) title(Original image) subplot(,3,2)simshow(Noi_imttle( Noisy image’) subplot(1,3,3):imshow(uint® (de_noi stitle(Denoised image!) (MU-New Sylabus wes academic year 21-22) (M6-108) Tech-Neo Publications..A SACHIN SHAH Venture Fig. Ex. 2.3.2(a) (ili) Order -Statistic Filter 1 UQ. What isa Median fllte, maximum fier and ! minimum fiter? When is the median filter not 1 ‘effective in noise removal wu Dec. 2017, 10 Marks) ‘The order-statistical filters are usually mon linear filters, which are hardly represented by convolution ‘Commonly used filters include median filter. ‘+ There are some other filters as well as Max/Min filter. Median filtering is a nonlinear method used to remove noise from images. It is widely used as; it is very effective at removing noise while preserving edges. It is particularly effective at removing ‘salt and pepper type noise, The median filter works by moving through the image pixel by pixel, replacing each value with the median value of neighbouring pixels © The pattern of neighbours is called the “ which slides, pixel by pixel over the entire image. The median is calculated first, by sorting all the pixel values from the window into numerical order, and then replacing the pixel being considered with the middle (median) pixel value © Similarly, the Max/Min filter replaces the value of the pixel with the maximum/minimum value within its neighbourhood. in filter is anon linear filter {UQ. Show that a median filter is anon linear filter, re eer 3(b), May 2018, 10 Mark: Nonlinear filters are those for which the linearity relationship breaks down. Consider two signals A and B, for linear filter such as mean filter Fr, Fm (A+ 3B) = Fin(A) +2.Fn(B) (MU-New Syllabus w.ef academic year 21-22) (M6-108) But, the equation is not satisfied for a nontnes fy has the median filer. In application, the median fg removes outliers and shot noise that is independem o¢ magnitude, while mean filter serves smoothing purpose, x y nt% af-- af | 24 1 >; " oye" omeet* ian filter illustration Fig. 2.3.1: Mean/me To understand the linearity property more easly, Letus r the above diagram; here we have 2 sequenes cor namely Xq and Yq. ‘When we add both the sequence we get Xn+¥a whose amplitude value is represented with blue color, When sty system which satisfies this condition, then itis calle linet. In case of mean filter : Mean value for sequence X, is l+1+3 5 3 3 Mean value for sequence Y,, is 14240 3 Mean value for Xy+Y, is 24343 3 Mean (X,) + Mean (Y) = Mean (Xq + Yq)s 5 +1 Hence, we called mean filter as linear filter. Barech-neo Publications... SACHIN SHAH Ve Image Processing (MU - Sem 6 - IT) uw Examples based on Median filter ' tneian filter to a simple one dimensional signal a medi © sotn. : A window size of three is used, with one entry immediately preceding and following each entry. 3 52/3] 8}6|2]/2]9 y(I] = median (3 39) =3 y(2] = median (349) =4 y(3] = median [4.9 52) =9 y(4]_ = median (3 4.52) =4 yGS) = median (3 8 52) =8 y(6] = median (3 68) = y(7] = median (268) =6 18] = median (226) =2 y19] = median (229) =2 ¥ {0} = median (299) =9 ¥ = For y [1] and y {9}, extend th Most value outside the bou leaving left. median, he left-most or right indaries of the image same as ‘ost or tight most value unchanged after 1-D Output Signal derived is v= [s[4]s]alelele 2]2\9 In an image below, on the left ig ‘eniicant amount of salt and peppe the same image after filter, Er an image containing a noise. On the right is a median filter median Processing with Fig. Ex. 2.3.4 (MU-New sytlabus ef academic vaar 24-29

You might also like