OpenCV

convolution

728x90
import cv2
import numpy as np

img = cv2.imread('data\images\gaussian-noise.png')

kernel_size = 3
kernel = np.ones((kernel_size,kernel_size))

#컨볼루션 시행 cv2.filter2D함수
result = cv2.filter2D(img,-1,kernel)

cv2.imshow('img',img)
cv2.imshow('result',result)

cv2.waitKey(0)
cv2.destroyAllWindows()

728x90

'OpenCV' 카테고리의 다른 글

gaussianBlur  (0) 2021.04.20
boxfilter  (0) 2021.04.20
warming/cooling  (0) 2021.04.20
gamma  (0) 2021.04.20
contrast HistEq  (0) 2021.04.20