22_边缘检测

import cv2
img = cv2.imread('lcc.jpg',1)
Info = img.shape
height = Info[0]
width = Info[1]
height = int(0.5*height)
width = int(0.5*width)
img = cv2.resize(img,(height,width))
#cv2.imshow('img',img)
#canny  1 gray   2 gaussian  3 canny
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
imgG = cv2.GaussianBlur(gray,(3,3),0) # (3,3)是模板大小
dst = cv2.Canny(imgG,50,250)  #是img吗,50是阈值
cv2.imshow('dst',dst)
cv2.waitKey(0)
上一篇:21_颜色反转


下一篇:OLAP 一些扯淡