import cv2 as cv
import numpy as np
def lapalian_demo(image):#拉普拉斯
dst = cv.Laplacian(image, cv.CV_32F)#原生拉普拉斯
lpls = cv.convertScaleAbs(dst)
cv.imshow("lapalian_demo", lpls)
print("--------- Python OpenCV Tutorial ---------")
src = cv.imread("D:/example/1.png")
cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)
cv.imshow("input image", src)
lapalian_demo(src)
cv.waitKey(0)
cv.destroyAllWindows()
原图效果
lapalian_demo效果