当前位置:网站首页>Opencv learning note 3 - image smoothing / denoising
Opencv learning note 3 - image smoothing / denoising
2022-07-07 08:23:00 【I am a little rice】
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from PIL import Image
image1 = mpimg.imread('image.png')
plt.imshow(image1);
1. Mean filtering
One 3×3 Convolution kernel , All values are 1
image2 = cv2.blur(image1, (3,3))
plt.imshow(image2)
2. Box filtering
there -1 Express , The number of input and output color channels is consistent
One 3×3 Convolution kernel , All values are 1
normalize Indicates whether the average is taken during convolution , by false Express , Sum only , exceed 255, Take... Directly 255
image3 = cv2.boxFilter(image1, -1, (3,3), normalize=False)
plt.imshow(image3);
3. Gauss filtering
Convolution kernel is not all 1 了 . But the value near the middle is larger
image4 = cv2.GaussianBlur(image1, (5,5), 1)
plt.imshow(image4)
4. median filtering
image5 = cv2.medianBlur(image1, 5)
plt.imshow(image5)
边栏推荐
- Splunk查询csv lookup table数据动态查询
- Vulnerability recurrence easy_ tornado
- Openjudge noi 2.1 1752: chicken and rabbit in the same cage
- 电池、电机技术受到很大关注,反而电控技术却很少被提及?
- 数据中台落地实施之法
- One click deployment of highly available emqx clusters in rainbow
- DeiT学习笔记
- 解析机器人科技发展观对社会研究论
- Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
- Wang Zijian: is the NFT of Tencent magic core worth buying?
猜你喜欢
随机推荐
offer收割机:两个长字符串数字相加求和(经典面试算法题)
The largest 3 same digits in the string of leetcode simple question
Excel import function of jeesite form page
Wang Zijian: is the NFT of Tencent magic core worth buying?
[quick start of Digital IC Verification] 13. SystemVerilog interface and program learning
Caractéristiques de bisenet
Call pytorch API to complete linear regression
Ebpf cilium practice (2) - underlying network observability
在Rainbond中实现数据库结构自动化升级
[quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
It's too true. There's a reason why I haven't been rich
Bisenet features
Give full play to the wide practicality of maker education space
MES系統,是企業生產的必要選擇
Standard function let and generic extension function in kotlin
【雅思口语】安娜口语学习记录 Part2
使用BiSeNet实现自己的数据集