当前位置:网站首页>Opencv learning Day5
Opencv learning Day5
2022-07-24 09:18:00 【SKYWALKERS_ two thousand three hundred and ninety-seven】
Psychology - Corrosion operation
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((5, 5),np.uint8)# Determine the scope of each corrosion
erosion = cv2.erode(img,kernel,iterations = 1)#iterations For the number of iterations , More iterations , The deeper the corrosion
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()


Change the number of iterations
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((5, 5),np.uint8)# Determine the scope of each corrosion
erosion = cv2.erode(img,kernel,iterations = 3)#iterations For the number of iterations , More iterations , The deeper the corrosion
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()

Change corrosion range
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((9, 9),np.uint8)# Determine the scope of each corrosion
erosion = cv2.erode(img,kernel,iterations = 1)#iterations For the number of iterations , More iterations , The deeper the corrosion
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()

Expansion operation
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((9, 9),np.uint8)# Determine the scope of each corrosion
erosion = cv2.erode(img,kernel,iterations = 1)#iterations For the number of iterations , More iterations , The deeper the corrosion
cv2.imshow('erosion', erosion)
kernel = np.ones((9, 9),np.uint8)# Determine the scope of each corrosion
dilate = cv2.dilate(erosion,kernel,iterations = 1)#iterations For the number of iterations , More iterations , The deeper the corrosion
cv2.imshow('dilate', dilate)
cv2.waitKey(0)
cv2.destroyAllWindows()



Expansion operation and corrosion operation are mutually inverse
边栏推荐
- Definition and initialization of cv:: mat
- Attack and defense world ----- confusion1
- S2b2b system standardizes the ordering and purchasing process and upgrades the supply chain system of household building materials industry
- Android system security - 5.3-apk V2 signature introduction
- Will your NFT disappear? Dfinity provides the best solution for NFT storage
- How to import CAD files into the map new earth and accurately stack them with the image terrain tilt model
- Code random notes_ Linked list_ Turn over the linked list in groups of 25K
- Getting started with sorting - insert sorting and Hill sorting
- Unity solves the package manager "you see to be offline"
- 科目1-3
猜你喜欢

排序入门—插入排序和希尔排序

How to judge and analyze NFT market briefly through NFT go?

Attack and defense world ----- confusion1

One year after I came to Ali, I ushered in my first job change

Little dolphin "transformed" into a new intelligent scheduling engine, which can be explained in simple terms in the practical development and application of DDS

我们说的组件自定义事件到底是什么?
![[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?](/img/57/0ebff0839d2a2898472d3270fd13df.png)
[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?

Account 1-2

【我的创作一周年纪念日】爱情是需要被纪念的,创作也是

Gnuplot software learning notes
随机推荐
How can tiktok transport videos not be streaming limited?
Ansible 常用模块介绍
gnuplot软件学习笔记
Practice 4-6 number guessing game (15 points)
Virtual machine terminator terminal terminator installation tutorial
Map processing background management menu data
Let's test 5million pieces of data. How to use index acceleration reasonably?
Tiktok 16 popular categories, tiktok popular products to see which one you are suitable for?
[Luogu p5829] [template] mismatch tree (string) (KMP)
Guys, what parameters can be set when printing flinksql so that the values can be printed? This later section is omitted. It's inconvenient. I read the configuration on the official website
One click openstack single point mode environment deployment - preliminary construction
Makefile variables and dynamic library static library
Open source summer interview | learn with problems, Apache dolphin scheduler, Wang Fuzheng
Aruba学习笔记06-无线控制AC基础配置(CLI)
Unity solves the package manager "you see to be offline"
S2b2b system standardizes the ordering and purchasing process and upgrades the supply chain system of household building materials industry
Un7.22: how to upload videos and pictures simultaneously with the ruoyi framework in idea and vs Code?
Android系统安全 — 5.2-APK V1签名介绍
Problems and abuse of protocol buffers
Leetcode94-二叉树的中序遍历详解