当前位置:网站首页>Digital image processing learning (II): Gaussian low pass filter
Digital image processing learning (II): Gaussian low pass filter
2022-06-26 08:32:00 【Yu Getou】
Introduce
- The formula :
- x,y It's the coordinates of the pixels
- σ Is the standard deviation of normal distribution ,σ The size of will affect the final processing effect ,σ The bigger it is , The more obvious the effect of noise processing , But the more blurred the image , It is better to compare and select this value in practical application .

- Treatment process : Similar to median filter and average filter , Gauss low-pass filtering also defines a fixed size window first ( Also known as Gaussian filter template ), Then calculate the value of each point of the template through the above formula , And then through iteration , Process each pixel of the image .
attach : The high frequency part of an image is usually edge information , Therefore, low-pass filters generally blur the image .
Code implementation
Function function
% Gaussian low pass filter
% img Pass in the image
% N_size Defined template size , Odd value required
% sigma Standard deviation
function H = GaussianLowpass(img, N_size, sigma)
% Define the image length and width
N_row = N_size;
N_col = N_size;
% Gaussian filter template
G_ry = zeros(N_row, N_col);
% Find the center point of the image
center = (N_size + 1) / 2;
% Solution template
for i=1 : N_row
for j=1 : N_col
distance_s = double((i-center-1)^2 + (j-center-1)^2);
G_ry(i,j)=exp((-1) * distance_s/(2*sigma^2))/(2*pi*(sigma^2));
end
end
% Image filtering
H = imfilter(img,G_ry);
end
The main function
% Load Images
img = imread("photo.jpeg");
% Image binarization
img = rgb2gray(img);
% Gauss filtering
G_img = GaussianLowpass(img, 15, 1.2);
% Draw pictures before and after processing
figure;
imshow(img);
title(" Original picture ");
figure;
imshow(G_img);
title(" Gauss filter effect picture ");
Effect display

边栏推荐
- Use of jupyter notebook
- 多台三菱PLC如何实现无线以太网高速通讯?
- Late 2021 plan
- OpenCV Learning notes iii
- Method of measuring ripple of switching power supply
- (vs2019 MFC connects to MySQL) make a simple login interface (detailed)
- Using transformers of hugging face to realize named entity recognition
- Recovering the system with Clonezilla USB disk
- Solve the problem that pychar's terminal cannot enter the venv environment
- Opencv learning notes 3
猜你喜欢

HEVC学习之码流分析
GHUnit: Unit Testing Objective-C for the iPhone

STM32 project design: an e-reader making tutorial based on stm32f4

Use a switch to control the lighting and extinguishing of LEP lamp

STM32 project design: smart home system design based on stm32

Compiling owncloud client on win10

Oracle 19C local listener configuration error - no listener

Comparison between Apple Wireless charging scheme and 5W wireless charging scheme

How to realize wireless Ethernet high-speed communication for multiple Mitsubishi PLCs?

Relationship extraction --tplinker
随机推荐
Introduction of laser drive circuit
Application of wireless charging receiving chip xs016 coffee mixing cup
Two ways to realize time format printing
nn. Modulelist and nn Sequential
Delete dictionary from list
Solve the problem that pychar's terminal cannot enter the venv environment
swift 代码实现方法调用
Necessary protection ring for weak current detection
鲸会务为活动现场提供数字化升级方案
RecyclerView Item 根据 x,y 坐标得到当前position(位置)
The solution of installing opencv with setting in pycharm
STM32 project design: temperature, humidity and air quality alarm, sharing source code and PCB
Relationship extraction --r-bert
Interpretation of x-vlm multimodal model
StarWar armor combined with scanning target location
STM32 based d18s20 (one wire)
leetcode2022年度刷题分类型总结(十二)并查集
Detailed explanation of SOC multi-core startup process
opencv学习笔记二
How to Use Instruments in Xcode