下面展示一些 内联代码片
。
# 导入相关的库
import cv2
import numpy as np
from scipy import ndimage
from study_NumPy.filters import strokeEdges
x = 1
y = -8*x+0 (0是锐化效果,1不高光,试试就知道了)
kernel = np.array([[x,x,x],
[x,y,x],
[x,x,x]])
img = cv2.imread('123.jpg')
img_1 = strokeEdges(img , 3)
img_2 = cv2.filter2D(img,-1,kernel)
img_3 = cv2.Canny(img, 200,300)
# 显示图片
cv2.imshow('0', img)
cv2.imshow('1', img_1)
cv2.imshow('2', img_2)
cv2.imshow('3', img_3)
# 等待键盘按键
cv2.waitKey()
# 关闭窗口并退出
cv2.destroyAllWindows()