当前位置:网站首页>OPENCV学习DAY5
OPENCV学习DAY5
2022-07-24 09:15:00 【SKYWALKERS_2397】
心态学-腐蚀操作
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((5, 5),np.uint8)#决定每次腐蚀的范围
erosion = cv2.erode(img,kernel,iterations = 1)#iterations为迭代次数,迭代次数越多,腐蚀程度越深
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()


改变迭代次数
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((5, 5),np.uint8)#决定每次腐蚀的范围
erosion = cv2.erode(img,kernel,iterations = 3)#iterations为迭代次数,迭代次数越多,腐蚀程度越深
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()

改变腐蚀范围
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((9, 9),np.uint8)#决定每次腐蚀的范围
erosion = cv2.erode(img,kernel,iterations = 1)#iterations为迭代次数,迭代次数越多,腐蚀程度越深
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()

膨胀操作
import cv2
import numpy as np
img = cv2.imread('qing.jpg')
cv2.imshow('img',img)
kernel = np.ones((9, 9),np.uint8)#决定每次腐蚀的范围
erosion = cv2.erode(img,kernel,iterations = 1)#iterations为迭代次数,迭代次数越多,腐蚀程度越深
cv2.imshow('erosion', erosion)
kernel = np.ones((9, 9),np.uint8)#决定每次腐蚀的范围
dilate = cv2.dilate(erosion,kernel,iterations = 1)#iterations为迭代次数,迭代次数越多,腐蚀程度越深
cv2.imshow('dilate', dilate)
cv2.waitKey(0)
cv2.destroyAllWindows()



膨胀操作与腐蚀操作互逆
边栏推荐
- Tiktok shop platform will take disciplinary measures against sellers who violate rules and policies
- Open source summer interview | learn with problems, Apache dolphin scheduler, Wang Fuzheng
- How should tiktok shop cooperate with live broadcast in the background?
- 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
- Account 1-3
- Es document CRUD
- CUDA day 2: GPU core and Sm core components [easy to understand]
- Map processing background management menu data
- One year after I came to Ali, I ushered in my first job change
- 读写锁、共享锁、独占锁
猜你喜欢

链表——19. 删除链表的倒数第 N 个结点

Interviewer: man, how much do you know about the read-write lock of go language?

Paclitaxel loaded tpgs reduced albumin nanoparticles /ga-hsa gambogic acid human serum protein nanoparticles

代码随想录笔记_链表_25K个一组翻转链表

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

Linked list - 19. Delete the penultimate node of the linked list

Using OpenCV to do a simple face recognition

我们说的组件自定义事件到底是什么?

Discuz论坛搭建详细过程,一看就懂

【我的创作一周年纪念日】爱情是需要被纪念的,创作也是
随机推荐
Es search summary
Unity C tool class arrayhelper
Little dolphin "transformed" into a new intelligent scheduling engine, which can be explained in simple terms in the practical development and application of DDS
Ue5 film and television animation rendering MRQ layered learning notes
Tiktok 16 popular categories, tiktok popular products to see which one you are suitable for?
Map processing background management menu data
C语言练习题目+答案:
dp最长公共子序列详细版本(LCS)
With 8 years of product experience, I have summarized these practical experience of continuous and efficient research and development
[assembly language practice] (II). Write a program to calculate the value of expression w=v- (x+y+z-51) (including code and process screenshots)
Wildcards in MySQL like statements: percent, underscore, and escape
Practice 4-6 number guessing game (15 points)
Leetcode94-二叉树的中序遍历详解
js定位大全获取节点的兄弟,父级,子级元素含robot实例
Data center: started in Alibaba and started in Daas
xtrabackup 实现mysql的全量备份与增量备份
Using OpenCV to do a simple face recognition
Rocky basics shell script Basics
Seven data show the impact of tiktok's combination of payment and organic content
Houdini official HDA sidefx labs installation