import numpy as np
import cv2
I=cv2.imread("/home/xiaomingming/profile/xmm.jpg",cv2.IMREAD_GRAYSCALE)
cv2.imshow("I",I)
r=1
MAX_R=20
cv2.namedWindow("dilate",1)
def nothing(*arg):
pass
cv2.createTrackbar("r","dilate",r,MAX_R,nothing)
while True:
r=cv2.getTrackbarPos('r','dilate')
s=cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(2*r+1,2*r+1))
d=cv2.dilate(I,s,iterations=30)
cv2.imshow("dilate",d)
ch=cv2.waitKey(5)
if ch==27:
break
cv2.destroyAllWindows()
相关文章
- 01-08修改OpenCV一行代码,提升14%图像匹配效果
- 01-08图像旋转后背景填白(python代码)
- 01-08Python语言利用PyQt5和openCV显示笔记本电脑摄像头图像
- 01-08Python-OpenCV 图像叠加加权实现
- 01-08【Python】opencv显示图像
- 01-08opencv处理验证码python代码
- 01-08Python+OpenCV图像处理(二)——打印图片属性、设置图片存储路径、电脑摄像头的调取和显示
- 01-08Python+OpenCV图像处理(一)
- 01-08OpenCV-Python教程:从视频文件、相机获取图像、写视频文件(VedioCapture,VedioWrite)
- 01-08python+openCV图像处理(十七)