当前位置:网站首页>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

边栏推荐
- STM32 porting mpu6050/9250 DMP official library (motion_driver_6.12) modifying and porting DMP simple tutorial
- Design of reverse five times voltage amplifier circuit
- Software engineering - high cohesion and low coupling
- Relationship extraction -- casrel
- 你为什么会浮躁
- Idea uses regular expressions for global substitution
- CodeBlocks集成Objective-C开发
- Relevant knowledge of DRF
- How to Use Instruments in Xcode
- 鲸会务一站式智能会议系统帮助主办方实现数字化会议管理
猜你喜欢

Opencv learning notes 3

多台三菱PLC如何实现无线以太网高速通讯?
![[postgraduate entrance examination] group planning exercises: memory](/img/ac/5c63568399f68910a888ac91e0400c.png)
[postgraduate entrance examination] group planning exercises: memory

Idea auto Guide

Cause analysis of serial communication overshoot and method of termination

STM32 project design: smart home system design based on stm32

static const与static constexpr的类内数据成员初始化

Introduction of laser drive circuit

Can the encrypted JS code and variable name be cracked and restored?

xxl-job配置告警邮件通知
随机推荐
nn. Modulelist and nn Sequential
三菱PLC若想实现以太网无线通讯,需要具备哪些条件?
Addition of attention function in yolov5
2020-10-29
What is Qi certification Qi certification process
Compiling owncloud client on win10
Example of offset voltage of operational amplifier
Discrete device ~ resistance capacitance
Design of reverse five times voltage amplifier circuit
Diode voltage doubling circuit
STM32 project design: an e-reader making tutorial based on stm32f4
Timer code guide in optee
SOC的多核启动流程详解
Two ways to realize time format printing
MySQL query time period
Parameter understanding of quad dataloader in yolov5
2020-10-20
Use of jupyter notebook
CodeBlocks集成Objective-C开发
X-VLM多模态模型解读