资源简介
该程序给图像添加正弦噪声,然后使用类似Notch Filter将该噪声在Fourier空间中去除。
代码片段和文件信息
function [ imageFiltered ] = removeSinoise( strOriginalImage A U0 V0)
%% Function Description
%REMOVESINOISE Add sinusoidal noise to an image and then remove the noise
% Add sinusoidal noise to an image STRORIGINALIMAGE and the sinusoidal
% noise N(xy) is determined by the parameter AUV in the following
% formula: N(xy) = Asin(2*pi*U0*x + 2*pi*V0*y).
% After N(xy) is added the noise is removed in the Fourier Space and
% then get the returned image IMAGEFILTERED
%
% STRORIGINALIMAGE
% The original input image to be operated. It can be RGB image or
% GRAY image.
% A
% The amplitude of the noise to add.
% U0 V0
% The Vertical and Horizontal direction components of the sinusoidal
% noise respectively. They determine the frequencies in vertical
% and horizontal direction.
%
% Author: Guangchun Cheng Department of Computer Science and Egineering
% @ University of North Texas.
% Date: 10/15/2010
close all;
%% STEP1~STEP : Generate Noisy Image
% STEP 1: read an image and convert it to gray scale if it‘s RGB image.
imageOrigin = imread(strOriginalImage);
[M N P] = size(imageOrigin);
if P>1
imageGray = rgb2gray(imageOrigin);
end
figure imshow(mat2gray(imageGray)); title(‘Original Image‘);
% show the Fourier frequency spectrum of the original image
% imageGrayDouble = double(imageGray);
% imFft = fftshift(fft2(imageGrayDouble));
% imFft = log(1+abs(imFft));
% figure imshow(mat2gray(imFft)); title(‘Original Lenna Freq Spectrum‘);
% STEP 2: Generate noise image N(xy)=Asin(2*pi*U0*x/M + 2*pi*V0*y/N)
% according to the input parameters (A U0 V0).
imNoise=zeros(MN);
for x=1:M
for y=1:N
imNoise(xy)=A(1)*sin(2*pi*(x/M)*U0 + 2*pi*(y/N)*V0);
end
end
figure imshow(mat2gray(imNoise)); title(‘Noise Image‘);
% show the Fourier frequency spectrum image of the noise image
imFft = fft2(imNoise);
imFft = log(1+abs(fftshift(imFft)));
figure imshow(mat2gray(imFft)); title(‘Noise Freq Spectrum‘);
% STEP 3: Add noise image to the original image and show the result
% in spatial space.
imNoiseUint = uint8(imNoise);
imNoisyImage = mat
- 上一篇:电流滞环整流matlab仿真模型
- 下一篇:PLA简单matlab实现
相关资源
- 使用fft方法产生FGN分形高斯噪声
- QPSK信号+白噪声程序MATLAB
- 脉冲噪声程序
- matlab加椒盐噪声和滤噪的方法
- 带高斯白噪声的Kalman滤波Matlab代码带
- 傅里叶梅林FourierMellin实现图像配准
- 分步傅里叶法Matlab代码共享代码
- 主动噪声控制FxAP算法
- QPSK高斯白噪声信道和瑞利信道的误码
- AM调制解调matlab实验代码加噪声
- matlab椒盐高斯混合噪声滤波
- DSP计算机作业 自适应噪声抵消LMS算法
- 基于FPGA的DDS正弦载波产生器
- matlab非平稳信号噪声消除
- MATLAB中用FIR和IIR滤波器滤除高频噪声
- BP神经网络 拟合正弦曲线的
- MATLAB中图像背景噪声去除
- 用matlab生成正弦表程序.m文件
- 方波、三角波、正弦波函数信号发生
- 频域整形法构造1/f噪声
- 对伪随机信号,白噪声信号,正弦信
- bpsk在高斯白噪声信道中调制解调MAT
- 信号的捕获(直接序列扩频系统的m
- 正弦波 方波 三角波 发生器 multisim
- 16PSK眼图,星座图,误码率,噪声特性
- 宽带与窄带信号主动噪声控制
- 主动噪声控制FxLMS算法
- Parameters.mat
- 有色噪声背景下正弦信号频率估计的
- 小脑神经网络进行正弦函数拟合的m
评论
共有 条评论