当前位置:网站首页>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)
边栏推荐
- 2022 Inner Mongolia latest advanced fire facility operator simulation examination question bank and answers
- Offer harvester: add and sum two long string numbers (classic interview algorithm question)
- Interview questions (CAS)
- Use of JMeter
- Four items that should be included in the management system of integral mall
- 漏洞複現-Fastjson 反序列化
- Jmeter 的使用
- Implementation of replacement function of shell script
- 电池、电机技术受到很大关注,反而电控技术却很少被提及?
- Bugku CTF daily one question chessboard with only black chess
猜你喜欢
快解析内网穿透助力外贸管理行业应对多种挑战
Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
在Rainbond中实现数据库结构自动化升级
央视太暖心了,手把手教你写HR最喜欢的简历
【踩坑系列】uniapp之h5 跨域的问题
Fast parsing intranet penetration escorts the document encryption industry
云原生存储解决方案Rook-Ceph与Rainbond结合的实践
Basic use of CTF web shrink template injection nmap
漏洞复现-Fastjson 反序列化
拓维信息使用 Rainbond 的云原生落地实践
随机推荐
Search for an element in a binary search tree (BST)
Example of file segmentation
ROS Bridge 笔记(05)— carla_ackermann_control 功能包(将Ackermann messages 转化为 CarlaEgoVehicleControl 消息)
Dedecms collects content without writing rules
利用 Helm 在各类 Kubernetes 中安装 Rainbond
Leetcode 187 Repeated DNA sequence (2022.07.06)
Complex network modeling (II)
Recursive construction of maximum binary tree
Zcmu--1492: problem d (C language)
ROS bridge notes (05) - Carla_ ackermann_ Control function package (convert Ackermann messages into carlaegovehiclecontrol messages)
jeeSite 表单页面的Excel 导入功能
Zcmu--1396: queue problem (2)
拓维信息使用 Rainbond 的云原生落地实践
Implementation of replacement function of shell script
解析机器人科技发展观对社会研究论
海信电视开启开发者模式
积分商城管理系统中应包含的四大项
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
Network learning (II) -- Introduction to socket
The legend about reading the configuration file under SRC