当前位置:网站首页>opencv学习笔记三——图像平滑/去噪处理
opencv学习笔记三——图像平滑/去噪处理
2022-07-07 05:19:00 【我是一个小稻米】
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. 均值滤波
一个3×3的卷积核,其中的值都为1
image2 = cv2.blur(image1, (3,3))
plt.imshow(image2)

2. 方框滤波
这里的-1表示,输入与输出的颜色通道数是一致的
一个3×3的卷积核,其中的值都为1
normalize表示在卷积时是否取平均,为false表示,只取和,超过255,直接取255
image3 = cv2.boxFilter(image1, -1, (3,3), normalize=False)
plt.imshow(image3);

3. 高斯滤波
卷积核不全为1了。而是靠近中间的值更大
image4 = cv2.GaussianBlur(image1, (5,5), 1)
plt.imshow(image4)

4. 中值滤波
image5 = cv2.medianBlur(image1, 5)
plt.imshow(image5)

边栏推荐
- B. Value sequence thinking
- Topic not received? Try this
- ZCMU--1492: Problem D(C语言)
- LeetCode简单题之判断一个数的数字计数是否等于数位的值
- Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
- 追风赶月莫停留,平芜尽处是春山
- Rainbond 5.7.1 支持对接多家公有云和集群异常报警
- JS cross browser parsing XML application
- 面试题(CAS)
- Codeforce c.strange test and acwing
猜你喜欢

Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu

The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number

解析创新教育体系中的创客教育

在 Rainbond 中一键安装高可用 Nacos 集群

青龙面板-今日头条

Register of assembly language by Wang Shuang

柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户

Interactive book delivery - signed version of Oracle DBA work notes

Complex network modeling (I)

Excel import function of jeesite form page
随机推荐
game攻防世界逆向
Application of slip ring of shipborne radar antenna
【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO
【无标题】
在 Rainbond 中一键安装高可用 Nacos 集群
Es FAQ summary
UnityHub破解&Unity破解
Uniapp mobile terminal forced update function
Complex network modeling (III)
互动送书-《Oracle DBA工作笔记》签名版
【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)
LeetCode中等题之我的日程安排表 I
机器人教育在动手实践中的真理
Network learning (III) -- highly concurrent socket programming (epoll)
The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
Blob 對象介紹
利用 Helm 在各类 Kubernetes 中安装 Rainbond
通俗易懂单点登录SSO
buureservewp(2)
Leetcode medium question my schedule I