标签:des style blog http color os io strong ar
Convolves an image with the kernel.
Parameters: |
|
---|
The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode.
# -*- coding: utf-8 -*- #卷积滤波 #code:myhaspl@myhaspl.com import cv2 import numpy as np fn="test2.jpg" myimg=cv2.imread(fn) img=cv2.cvtColor(myimg,cv2.COLOR_BGR2GRAY) myh=np.array([[0,1,0],[1,-4,1],[0,1,0]]) jgimg=cv2.filter2D(img,-1,myh) cv2.imshow(‘src‘,img) cv2.imshow(‘dst‘,jgimg) cv2.waitKey() cv2.destroyAllWindows()
标签:des style blog http color os io strong ar
原文地址:http://www.cnblogs.com/mengfanrong/p/3945426.html