Filter2d
Convolves an image with the kernel.
-
-
C + +: void filter2d ( inputarray
src , outputarray
DST , int
ddepth , Inputarray
kernel , point
anchor =point ( -1,-1), double
delta =0, int bordertype =border_default )
-
-
Python: Cv2. filter2d (SRC, ddepth, kernel [Dst [, anchor [, Delta [, Bordertype ] ] ] ] )→dst
-
-
C: void cvfilter2d ( Const cvarr*
src , cvarr*
DST , const cvmat*
Kernel, Cvpoint anchor =cvpoint ( -1,-1) )
-
-
Python: cv. filter2d (src, DST, kernel, anchor= ( -1,-1) ) →none
-
The function applies a arbitrary linear filter to an image. In-place operation is supported. When the aperture was partially outside the image, the function interpolates outlier pixel values according to the Specifie d Border mode.
#-*-Coding:utf-8-*- #卷积滤波 #code:[email protected]import cv2import numpy as npfn= "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 ()
the whole content of this blog is original, if reproduced please indicate the sourcehttp://blog.csdn.net/myhaspl/
Mathematical Road-python Calculation (19)-Machine vision-convolution filter