当前位置:网站首页>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
边栏推荐
- Assignment operator (geritilent software - Jiuye training)
- Android system security - 5.3-apk V2 signature introduction
- 云原生(十二) | Kubernetes篇之Kubernetes基础入门
- 如何通过NFT GO,来简要判断、分析NFT市场?
- Promise基础总结
- How to configure env.js in multiple environments in uni app
- Tang Yudi opencv background modeling
- Detailed sequence traversal of leetcode102 binary tree
- What is the "age limit" on tiktok and how to solve it?
- Aruba学习笔记06-无线控制AC基础配置(CLI)
猜你喜欢

Unity solves the package manager "you see to be offline"

Leetcode102-二叉树的层序遍历详解

Tiktok's "online celebrity" was poached by Amazon and broadcast on Amazon live platform

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

数据中台:始于阿里,兴于DaaS
![[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-3
![[FFH] openharmony gnawing paper growth plan -- Application of cjson in traditional c/s model](/img/a5/a8f4371a83fbd38c40aa7ba56a36d3.png)
[FFH] openharmony gnawing paper growth plan -- Application of cjson in traditional c/s model

Tiflash source code reading (V) deltatree storage engine design and implementation analysis - Part 2

Asyncdata cross domain error after nuxt route switching
随机推荐
Getting started with sorting - insert sorting and Hill sorting
DP longest common subsequence detailed version (LCS)
[FFH] websocket practice of real-time chat room
C # briefly describe the application of Richter's replacement principle
Code random notes_ Linked list_ Turn over the linked list in groups of 25K
Nuggets manufacturing industry, digital commerce cloud supply chain collaborative management system to achieve full chain intelligent management and control
JUC powerful auxiliary class
Makefile variables and dynamic library static library
Firewall off and on command
Account 1-2
Re6:读论文 LeSICiN: A Heterogeneous Graph-based Approach for Automatic Legal Statute Identification fro
SQL 优化原则
[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?
xtrabackup 实现mysql的全量备份与增量备份
How to open the port number of the server, and the corresponding port of common network services
科目1-2
gnuplot软件学习笔记
Un7.22: how to upload videos and pictures simultaneously with the ruoyi framework in idea and vs Code?
Matlab各函数说明
Let's test 5million pieces of data. How to use index acceleration reasonably?