# -*- coding: utf-8 -*- #线性锐化滤波-拉普拉斯算子进行二维卷积计算 #code:myhaspl@myhaspl.com import cv2 import numpy as np from scipy import signal fn="test6.jpg" myimg=cv2.imread(fn) img=cv2.cvtColor(myimg,cv2.COLOR_BGR2GRAY) srcimg=np.array(img,np.double) myh=np.array([[0,1,0],[1,-4,1],[0,1,0]]) myj=signal.convolve2d(srcimg,myh,mode="same") jgimg=img-myj cv2.imshow(‘src‘,img) cv2.imshow(‘dst‘,jgimg) cv2.waitKey() cv2.destroyAllWindows()
数学之路-python计算实战(20)-机器视觉-拉普拉斯算子卷积滤波,布布扣,bubuko.com
数学之路-python计算实战(20)-机器视觉-拉普拉斯算子卷积滤波
原文:http://blog.csdn.net/myhaspl/article/details/38169339