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

边栏推荐
- 在 KubeSphere 部署 Wiki 系统 wiki.js 并启用中文全文检索
- Can the encrypted JS code and variable name be cracked and restored?
- Necessary protection ring for weak current detection
- Torch model to tensorflow
- Use a switch to control the lighting and extinguishing of LEP lamp
- Recovering the system with Clonezilla USB disk
- 2020-10-20
- Is it safe to open an account in flush,
- Discrete device ~ resistance capacitance
- Software engineering - high cohesion and low coupling
猜你喜欢

Text to SQL model ----irnet

Application of wireless charging receiving chip xs016 coffee mixing cup

鲸会务一站式智能会议系统帮助主办方实现数字化会议管理

Idea auto Guide

Compiling owncloud client on win10

2020-10-20

MySQL practice: 4 Operation of data

Discrete device ~ diode triode

STM32 project design: smart home system design based on stm32

Necessary protection ring for weak current detection
随机推荐
Application of wireless charging receiving chip xs016 coffee mixing cup
Opencv learning notes II
Remote centralized control of distributed sensor signals using wireless technology
Timer code guide in optee
static const与static constexpr的类内数据成员初始化
Vs2019-mfc setting edit control and static text font size
The best time to buy and sell stocks to get the maximum return
CodeBlocks集成Objective-C开发
Using transformers of hugging face to realize named entity recognition
1GHz active probe DIY
Idea update
Recovering the system with Clonezilla USB disk
(2) Buzzer
Assembly led on
[postgraduate entrance examination: planning group] clarify the relationship among memory, main memory, CPU, etc
What are the conditions for Mitsubishi PLC to realize Ethernet wireless communication?
SOC的多核启动流程详解
Leetcode22 summary of types of questions brushing in 2002 (XII) and collection search
KNN resolution
Two ways to realize time format printing