Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2

Similar presentations


Presentation on theme: "Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2"— Presentation transcript:

1 Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2

2 1. Filter the given 4 × 4 gray level image with:
(a) 3×3 mean filter using zero padding Zero padding of the borders.

3 Mean filter: The value of the processed pixel will be replaced by the average of the pixel values in the window. The corresponding convolution mask is: All the pixels are scanned from left to right and from up to down. The resulting image: The added borders are not processed.

4 (b) 3 × 3 weighted mean filter using zero padding with mask
First, zero padding of the borders. Second, Value of the processed pixel= [window matrix] dot product [convolution mask ] The resulting filtered image: Averaging filters: (Matlab) 1. Have a blurring effect on the image. 2. The blurring effect increases when the mask size increases. 3. As the noise reduces, also the local contrast becomes worse.

5 (c) 3 × 3 median filter processing only such pixels that have all the needed neighbors
Process only pixels that have all the needed neighbors. 3 × 3 median filter: The output image is obtained by selecting the median (the middle one when the values are in increasing order) of the values under the mask. The resulting image: Median filter: Reduces effectively impulsive noise, but the local contrast remains better. 2. Thin lines are however lost.

6 (d) Laplacian filter with the given mask and reflecting the border pixels.
The pixels are scanned using mask: The resulting image: (Matlab)

7 2. Compute the 2-D discrete Fourier transform of the following image:
Applying the 2-D Fourier transform directly. In our case, M = N = 4, so it becomes: F(0; 0), F(0; 1), F(0; 2),…, F(1; 3),…, F(3; 3) Resulting frequency domain image F(u; v):

8 (b) Using the separability of the Fourier transform.
Separability of the 2-D Fourier transform means that we can get the full 2-D transform by applying 1-D transform twice: First, apply the 1-D transform to rows. And then to columns of the image. Apply 1-D DFT to rows of the input image: The resulting intermediate image: Next, do 1-D DFT to columns of this intermediate image: Resulting frequency domain image:

9 3. Filter the image from the previous question with the following frequency space filter H
Image processed in the previous question: Image filtering in frequency space is done by: [ frequcency domain representation ] element-wise multiplication [ filter] Dot product

10 The filtered image is finally obtained through inverse DFT.

11 Summary: Time domain Frequency domain DFT input image f (x,y) F (u,v)
Inverse DFT output image g (x,y) G(u,v) = F (u,v) H(u,v)

12 4. High frequency emphasis filtering in frequency space can be expressed as:
The contrast of the resulting image can be further enhanced by applying histogram equalization. Does it matter, which process is applied first? If the order does matter, explain why one or the other operator should be applied first. Hints: (Matlab) 1. The high frequency emphasis filter could not only remain low frequency information (parameter k1) but also emphasize high frequency information (parameter k2). (Refer to page ) 2. The histogram equalization is to make the histogram distribution uniform, which could lose some low frequency information, such as the average gray scale value. Therefore, performing ‘high frequency emphasis filtering’ after ‘histogram Equalization’ would not compensate the lost low frequency information.

13

14


Download ppt "Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2"

Similar presentations


Ads by Google