数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter
實驗要求:
Objective:
To understand the principle of the notch filter and its periodic noise reducing ability.
Main requirements:
Ability of programming with C, C++, or Matlab.
Instruction manual:
(a) Write a program that implements sinusoidal noise of the form given in Problem 5.14. The inputs to the program must be the amplitude, A, and the two frequency components u0 and v0 shown in the problem equation.
(b) Download image 5.26(a) and add sinusoidal noise to it, with u0 = M/2 (the image is square) and v0 = 0. The value of A must be high enough for the noise to be quite visible in the image.
(c) Compute and display the spectrum of the image. If the FFT program you developed in Project 4.01 can only handle images of size equal to an integer power of 2, reduce the size of the image to 512 x 512 or 256 x 256 using the program from Project 02-04. Resize the image before adding noise to it.
(d) Notch-filter the image using a notch filter of the form shown in Fig. 5.19(c).
這個實驗的要求是使用陷波濾波器消除周期噪聲。
對于某種周期噪聲常常是以一對共軛的點的形式,出現(xiàn)在圖像的頻譜中,所以為我們使用一個陷波濾波器,使其正好對應(yīng)那對共軛點以消除周期噪聲。
實驗代碼:
% close all; clc; clear all;% img = imread('Fig5.26(a).jpg'); [M, N] = size(img); figure; subplot(2,3,1); imshow(img); title('原圖像');% 產(chǎn)生周期噪聲 C = [343, 0]; [noise, R, S] = imnoise3(M, N, C, 40000000); subplot(2,3,2); imshow(noise, []); title('噪聲');% 計算傅里葉變換 img1 = double(img); img2 = img1 + noise; img3 = fft2(img2); subplot(2,3,3); imshow(img3); title('傅里葉變換');% 生成濾波器 sig = 100; H = lpfilter('gaussian', M, N,sig); subplot(2,3,4); imshow(H); title('濾波器');% 頻率域濾波 img_G = H .* img3; subplot(2,3,5); imshow(img_G); title('頻域陷波濾波');% 傅里葉逆變換還原圖像到時域 img_g = real(ifft2(img_G)); img_g = mat2gray(img_g); subplot(2,3,6); imshow(img_g); title('陷波濾波結(jié)果');實驗結(jié)果:
總結(jié)
以上是生活随笔為你收集整理的数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数字图像处理实验(11):PROJECT
- 下一篇: 数字图像处理实验(13):PROJECT