当前位置:网站首页>MATLAB image processing - cosine noise removal in image (with code)
MATLAB image processing - cosine noise removal in image (with code)
2022-06-12 08:06:00 【HNU_ Liu Yuan】
Removal of regular cosine noise in image
Problem description
There are the following images after adding noise :
It is obvious from the picture that x A sinusoidal noise is superimposed in the direction , To denoise it , It is easier to map to the frequency domain , Observe where the noise occurs , Filter in frequency domain , Finally, the inverse Fourier transform .
Fourier transform
Fourier transform the original image to get :
It's hard to see from the picture above , Map it to x In the direction of , Get a one-dimensional distribution and get :
It can be seen that there are three spikes , The middle peak is useful information , What we need to keep , The two spikes nearby are caused by noise , So you can use Band stop filter Filter out the two peak noises .
Band stop filter
The two band stop filters constructed are shown in the figure below , The peak values filtered out are respectively 120 and 138 Noise at .
Use a band stop filter to multiply the projection of the Fourier spectrum , The range of band stop filter value is 0~1, The darker it is, the closer it is 0, The brighter it is, the closer it is 1.

wave filtering
Use the above filter to filter the Fourier transform spectrum , And in x Visualize in the direction to get :
It can be seen that the peak value is 120 and 138 The noise has been filtered out .
result
The inverse Fourier transform is performed to obtain :
It can be seen that , The image obtained after inverse Fourier transform , There is some picture distortion , The reason may be the operation of reducing the spectrum of the image from two dimensions to one dimension , In some places where there is no noise , The filtering operation is also carried out , So there will be a certain loss of information . If on the global information , That is to say, denoising on two-dimensional information should get better results .
improvement
Fine filtering of the square area in the figure should get better results .
Code
close all
f=imread('grid.bmp');
[M,N,~] = size(f); %f Is a noisy image
F = fftshift(fft2(f)); % Image frequency domain
figure;plot(abs(F(M/2+1,:))); % x Direction transverse line
% structure n Step Butterworth trap , You can modify D0 and n Get better results .
u = 0:(M-1);
v = 0:(N-1);
[V,U] = meshgrid(v,u);
D0 = 7;
n = 1;
v0 = 120;
v1 = 138;
D1 = abs(V-v0);
D2 = abs(V-v1);
H = 1./(1+(D0^2./(D1.*D2)).^n);
figure;imshow(H,[])
% wave filtering
G = fftshift(F.*H);
figure;plot(abs(F.*H(M/2+1,:))); % x Direction transverse line
g = real(ifft2(G));
figure;
subplot(121); imshow(f,[]);
subplot(122),imshow(g,[]);
边栏推荐
- Pytorch profiler with tensorboard.
- 20220525 RCNN--->Faster RCNN
- Windows10 configuration database
- Derivation of Poisson distribution
- Summary of 3D point cloud construction plane method
- Mathematical Essays: Notes on the angle between vectors in high dimensional space
- 2D visualization of oil storage, transportation and production, configuration application enables intelligent development of industry
- 二、八、十、十六进制相互转换
- Process terminated
- Ceres optimizer usage (self use)
猜你喜欢

记录谷粒商城踩坑(一)

The latest hbuilderx editing uni app project runs in the night God simulator

Mathematical knowledge - matrix - matrix / vector derivation

Topic 1 Single_ Cell_ analysis(1)

Explain the basic working principle of Ethernet

Discrete chapter I

Literature reading: raise a child in large language model: rewards effective and generalizable fine tuning

Pytorch installation (GPU) in Anaconda (step on pit + fill pit)

Windows10 configuration database

Detailed explanation of Google open source sfmlearner paper combining in-depth learning slam -unsupervised learning of depth and ego motion from video
随机推荐
PPP agreement
Topic 1 Single_Cell_analysis(3)
Topic 1 Single_Cell_analysis(2)
Summary of 3D point cloud construction plane method
Dynamic simulation method of security class using Matlab based Matpower toolbox
Leetcode notes: biweekly contest 71
计组第一章
MFC中窗口刷新函数详解
Topic 1 Single_Cell_analysis(1)
OpenMP task 原理與實例
模型压缩 | TIP 2022 - 蒸馏位置自适应:Spot-adaptive Knowledge Distillation
Getting started with Jetson nano Series IV: common skills of NVIDIA Jetson nano
记录谷粒商城踩坑(一)
Topic 1 Single_ Cell_ analysis(3)
Compiling principle on computer -- function drawing language (II): lexical analyzer
20220526 yolov1-v5
Literature reading: deep neural networks for YouTube recommendations
Cmake can't find the solution of sophus
Rich dad, poor dad Abstract
2D visualization of oil storage, transportation and production, configuration application enables intelligent development of industry